X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb%2Ftransaction.c;h=988296372c578bde1f04311e7f25aa66caa1ea4b;hp=c2e4748a8e7c668acb9c568660a59ab9c2f4cff6;hb=30d253bec03079999a63672477d83fbb8c4520cc;hpb=be590188c17bcd9324ba671d74d43a325cff5e70 diff --git a/ccan/tdb/transaction.c b/ccan/tdb/transaction.c index c2e4748a..98829637 100644 --- a/ccan/tdb/transaction.c +++ b/ccan/tdb/transaction.c @@ -969,7 +969,7 @@ static int _tdb_transaction_prepare_commit(struct tdb_context *tdb) /* write the recovery data to the end of the file */ if (transaction_setup_recovery(tdb, &tdb->transaction->magic_offset) == -1) { TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_prepare_commit: failed to setup recovery data\n")); - tdb_brunlock(tdb, F_WRLCK, GLOBAL_LOCK, 0); + tdb_brunlock(tdb, F_WRLCK, GLOBAL_LOCK, 1); _tdb_transaction_cancel(tdb, F_WRLCK); return -1; } @@ -984,7 +984,7 @@ static int _tdb_transaction_prepare_commit(struct tdb_context *tdb) tdb->transaction->old_map_size) == -1) { tdb->ecode = TDB_ERR_IO; TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_prepare_commit: expansion failed\n")); - tdb_brunlock(tdb, F_WRLCK, GLOBAL_LOCK, 0); + tdb_brunlock(tdb, F_WRLCK, GLOBAL_LOCK, 1); _tdb_transaction_cancel(tdb, F_WRLCK); return -1; } @@ -1080,7 +1080,7 @@ int tdb_transaction_commit(struct tdb_context *tdb) tdb_transaction_recover(tdb); _tdb_transaction_cancel(tdb, F_WRLCK); - tdb_brunlock(tdb, F_WRLCK, GLOBAL_LOCK, 0); + tdb_brunlock(tdb, F_WRLCK, GLOBAL_LOCK, 1); TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_commit: write failed\n")); return -1;