aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-09-03 13:30:57 +1000
committerKarolin Seeger <kseeger@samba.org>2018-09-20 14:05:59 +0200
commit189697a98bac80d2d815193f8c87e632e4923448 (patch)
tree220f26ef28b554bdb7fb34c8909b8b095cd42ef3
parent21e4884a1a3b25ee5fdf399b3d33bba3af004c99 (diff)
downloadsamba-189697a98bac80d2d815193f8c87e632e4923448.tar.gz
samba-189697a98bac80d2d815193f8c87e632e4923448.tar.xz
samba-189697a98bac80d2d815193f8c87e632e4923448.zip
ctdb-recoverd: Set recovery lock handle at start of attempt
This allows the attempt to be cancelled if an election is lost and an unlock is done before the attempt is completed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Tue Sep 18 02:18:30 CEST 2018 on sn-devel-144 (cherry picked from commit 486022ef8f43251258f255ffa15f1a01bc6aa2b7) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Thu Sep 20 14:05:59 CEST 2018 on sn-devel-144
-rw-r--r--ctdb/server/ctdb_recoverd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 5e49e8842d9..62e4c4655da 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -954,17 +954,18 @@ static bool ctdb_recovery_lock(struct ctdb_recoverd *rec)
return false;
}
+ rec->recovery_lock_handle = s;
+ s->h = h;
+
while (! s->done) {
tevent_loop_once(ctdb->ev);
}
if (! s->locked) {
- talloc_free(s);
+ TALLOC_FREE(rec->recovery_lock_handle);
return false;
}
- rec->recovery_lock_handle = s;
- s->h = h;
ctdb_ctrl_report_recd_lock_latency(ctdb,
CONTROL_TIMEOUT(),
s->latency);