summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2014-03-27 15:06:58 +1100
committerAmitay Isaacs <amitay@samba.org>2014-03-28 05:55:13 +0100
commit78015320b60b0fd0d8c3dc65fbbe3e38e4a02993 (patch)
tree525ea59db64fee7bd4309d502eb68110465ea675 /ctdb
parentaa7cd51bbc438555552584a7d71f5bae6909603f (diff)
downloadsamba-78015320b60b0fd0d8c3dc65fbbe3e38e4a02993.tar.gz
samba-78015320b60b0fd0d8c3dc65fbbe3e38e4a02993.tar.xz
samba-78015320b60b0fd0d8c3dc65fbbe3e38e4a02993.zip
ctdb-client: ctdb_fetch_lock should check for readonly delegations
When readonly delegations were added, ctdb_fetch_lock code should have been modified to include the check for readonly flags. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/client/ctdb_client.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index 885dbfdfb46..756011525db 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -709,6 +709,21 @@ again:
goto again;
}
+ /* if this is a request for read/write and we have delegations
+ we have to revoke all delegations first
+ */
+ if ((h->header.dmaster == ctdb_db->ctdb->pnn) &&
+ (h->header.flags & CTDB_REC_RO_HAVE_DELEGATIONS)) {
+ ctdb_ltdb_unlock(ctdb_db, key);
+ ret = ctdb_client_force_migration(ctdb_db, key);
+ if (ret != 0) {
+ DEBUG(DEBUG_DEBUG,("ctdb_fetch_readonly_lock: force_migration failed\n"));
+ talloc_free(h);
+ return NULL;
+ }
+ goto again;
+ }
+
DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: we are dmaster - done\n"));
return h;
}