]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-client: Use correct TDB flags for opening database
authorAmitay Isaacs <amitay@gmail.com>
Fri, 8 Apr 2016 04:29:13 +0000 (14:29 +1000)
committerMartin Schwenke <martins@samba.org>
Sun, 24 Apr 2016 01:25:26 +0000 (03:25 +0200)
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 <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sun Apr 24 03:25:27 CEST 2016 on sn-devel-144

ctdb/client/client_db.c

index d95e89e5316cdf18444195404018d02ce56b08ee..85d14e3fce3ec4c4f8edc939dcd7a6943477423e 100644 (file)
@@ -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) {