From: Martin Schwenke Date: Mon, 3 Sep 2018 03:30:57 +0000 (+1000) Subject: ctdb-recoverd: Set recovery lock handle at start of attempt X-Git-Tag: tdb-1.3.17~1532 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=486022ef8f43251258f255ffa15f1a01bc6aa2b7;p=thirdparty%2Fsamba.git 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 Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Sep 18 02:18:30 CEST 2018 on sn-devel-144 --- diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index d0eceee62f9..673c99c3d34 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -956,17 +956,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);