From: Stefan Metzmacher Date: Fri, 12 Dec 2014 10:22:47 +0000 (+0100) Subject: tdb: allow transactions on on tdb's with TDB_MUTEX_LOCKING X-Git-Url: http://git.samba.org/?p=obnox%2Fsamba%2Fsamba-obnox.git;a=commitdiff_plain;h=d0839af9d60a6fdf0720cd0b1a859e0e2241903f tdb: allow transactions on on tdb's with TDB_MUTEX_LOCKING 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 Reviewed-by: Amitay Isaacs --- diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c index caef0bedd82..0dd057ba7a7 100644 --- a/lib/tdb/common/transaction.c +++ b/lib/tdb/common/transaction.c @@ -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;