From: Amitay Isaacs Date: Fri, 8 Apr 2016 04:29:13 +0000 (+1000) Subject: ctdb-client: Use correct TDB flags for opening database X-Git-Tag: talloc-2.1.7~197 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f72883e8ad6723320f56a0045a95b2836110b82;p=thirdparty%2Fsamba.git ctdb-client: Use correct TDB flags for opening database Persistent: TDB_DEFAULT Volatile: TDB_NOSYNC | TDB_INCOMPATIBLE_HASH | TDB_CLEAR_IF_FIRST | TDB_MUTEX_LOCKING (if TDBMutexEnabled is set) Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sun Apr 24 03:25:27 CEST 2016 on sn-devel-144 --- diff --git a/ctdb/client/client_db.c b/ctdb/client/client_db.c index d95e89e5316..85d14e3fce3 100644 --- a/ctdb/client/client_db.c +++ b/ctdb/client/client_db.c @@ -326,13 +326,14 @@ static void ctdb_attach_mutex_done(struct tevent_req *subreq) mutex_enabled = 0; } - state->tdb_flags = TDB_DEFAULT; - if (! state->db->persistent) { - state->tdb_flags |= (TDB_INCOMPATIBLE_HASH | - TDB_CLEAR_IF_FIRST); - } - if (mutex_enabled == 1) { - state->tdb_flags |= TDB_MUTEX_LOCKING; + if (state->db->persistent) { + state->tdb_flags = TDB_DEFAULT; + } else { + state->tdb_flags = (TDB_NOSYNC | TDB_INCOMPATIBLE_HASH | + TDB_CLEAR_IF_FIRST); + if (mutex_enabled == 1) { + state->tdb_flags |= TDB_MUTEX_LOCKING; + } } if (state->db->persistent) {