diff options
author | Amitay Isaacs <amitay@gmail.com> | 2016-04-08 14:29:13 +1000 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2016-04-24 03:25:26 +0200 |
commit | 5f72883e8ad6723320f56a0045a95b2836110b82 (patch) | |
tree | f03449111257c98ccadbf104eadc36a45a579ba3 /ctdb/client | |
parent | 2a06e56f922894a2be8d54d98b955e26dfbf774e (diff) | |
download | samba-5f72883e8ad6723320f56a0045a95b2836110b82.tar.gz |
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 <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
Diffstat (limited to 'ctdb/client')
-rw-r--r-- | ctdb/client/client_db.c | 15 |
1 files changed, 8 insertions, 7 deletions
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) { |