diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-04-22 13:53:51 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-04-22 13:53:51 +0930 |
commit | 5f40176e88f5e9fface108f55758d9b61e494033 (patch) | |
tree | ac278227c349afdafaf03d5b00547c546eeb43d7 /ctdb/lib | |
parent | dca3421b603deb150acd9c9b1b2222f45dbac4d2 (diff) | |
download | samba-5f40176e88f5e9fface108f55758d9b61e494033.tar.gz samba-5f40176e88f5e9fface108f55758d9b61e494033.tar.xz samba-5f40176e88f5e9fface108f55758d9b61e494033.zip |
tdb: don't suppress the transaction lock because of the allrecord lock.
tdb_transaction_lock() and tdb_transaction_unlock() do nothing if we
hold the allrecord lock. However, the two locks don't overlap, so
this is wrong.
This simplification makes the transaction lock a straight-forward nested
lock.
There are two callers for these functions:
1) The transaction code, which already makes sure the allrecord_lock
isn't held.
2) The traverse code, which wants to stop transactions whether it has the
allrecord lock or not. There have been deadlocks here before, however
this should not bring them back (I hope!)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from commit b754f61d235bdc3e410b60014d6be4072645e16f)
(This used to be ctdb commit 495f3554259b9dbf9ee673c4fe420d98e50e4901)
Diffstat (limited to 'ctdb/lib')
-rw-r--r-- | ctdb/lib/tdb/common/lock.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/ctdb/lib/tdb/common/lock.c b/ctdb/lib/tdb/common/lock.c index e3759a3f8d..66cfcbdeea 100644 --- a/ctdb/lib/tdb/common/lock.c +++ b/ctdb/lib/tdb/common/lock.c @@ -420,9 +420,6 @@ int tdb_unlock(struct tdb_context *tdb, int list, int ltype) */ int tdb_transaction_lock(struct tdb_context *tdb, int ltype) { - if (tdb->allrecord_lock.count) { - return 0; - } if (tdb->transaction_lock_count > 0) { tdb->transaction_lock_count++; return 0; @@ -443,9 +440,6 @@ int tdb_transaction_lock(struct tdb_context *tdb, int ltype) int tdb_transaction_unlock(struct tdb_context *tdb, int ltype) { int ret; - if (tdb->allrecord_lock.count) { - return 0; - } if (tdb->transaction_lock_count > 1) { tdb->transaction_lock_count--; return 0; |