tdb: allow transactions on on tdb's with TDB_MUTEX_LOCKING
authorStefan Metzmacher <metze@samba.org>
Fri, 12 Dec 2014 10:22:47 +0000 (11:22 +0100)
committerAmitay Isaacs <amitay@samba.org>
Fri, 19 Dec 2014 08:20:06 +0000 (09:20 +0100)
There's no real reason to disallow transactions as the
allrecord lock is also available with mutexes enabled.

E.g. ctdbd requires transactions also on non-persistent databases
opened with TDB_CLEAR_IF_FIRST and TDB_MUTEX_LOCKING.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11004

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
lib/tdb/common/transaction.c

index caef0bedd820f4159073b7dd1ab7dbb49b673e6a..0dd057ba7a71151e5173cb6d9b25666f915eab27 100644 (file)
@@ -421,7 +421,7 @@ static int _tdb_transaction_start(struct tdb_context *tdb,
                                  enum tdb_lock_flags lockflags)
 {
        /* some sanity checks */
-       if (tdb->read_only || (tdb->flags & (TDB_INTERNAL|TDB_MUTEX_LOCKING))
+       if (tdb->read_only || (tdb->flags & TDB_INTERNAL)
            || tdb->traverse_read) {
                TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_start: cannot start a transaction on a read-only or internal db\n"));
                tdb->ecode = TDB_ERR_EINVAL;