]> git.ozlabs.org Git - ccan/commit
Import 898b5edfe757cb145960b8f3631029bfd5592119 from ctdb:
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 2 Feb 2010 02:00:40 +0000 (12:30 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 2 Feb 2010 02:00:40 +0000 (12:30 +1030)
commit176844c84ff5ae6a5f146c5d1b7a3927bd781739
treea2a2eca197e08bb864c38e4d780570f02161c094
parent9d045ca09a0b052d968e11d98540f63a8a0aa412
Import 898b5edfe757cb145960b8f3631029bfd5592119 from ctdb:
Author: Volker Lendecke <vl@samba.org>  2010-01-30 03:51:09

    tdb: fix an early release of the global lock that can cause data corruption

    There was a bug in tdb where the

                    tdb_brlock(tdb, GLOBAL_LOCK, F_UNLCK, F_SETLKW, 0, 1);

    (ending the transaction-"mutex") was done before the

                            /* remove the recovery marker */

    This means that when a transaction is committed there is a window where another
    opener of the file sees the transaction marker while the transaction committer
    is still fully functional and working on it. This led to transaction being
    rolled back by that second opener of the file while transaction_commit() gave
    no error to the caller.

    This patch moves the F_UNLCK to after the recovery marker was removed, closing
    this window.
ccan/tdb/test/external-transaction.c
ccan/tdb/transaction.c