From: Martin Schwenke Date: Tue, 11 Sep 2018 05:05:19 +0000 (+1000) Subject: ctdb-recoverd: Return early when the recovery lock is not held X-Git-Tag: samba-4.8.6~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da9bb48a459644801deac2514fc00c9c639c2ef5;p=thirdparty%2Fsamba.git ctdb-recoverd: Return early when the recovery lock is not held This makes upcoming changes simpler. Update to modern debug macro while touching relevant line. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs (cherry picked from commit a755d060c13b65dfb6d73979aaf111c489882bfb) --- diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 3df319bb022..33df06f2720 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -974,10 +974,12 @@ static bool ctdb_recovery_lock(struct ctdb_recoverd *rec) static void ctdb_recovery_unlock(struct ctdb_recoverd *rec) { - if (rec->recovery_lock_handle != NULL) { - DEBUG(DEBUG_NOTICE, ("Releasing recovery lock\n")); - TALLOC_FREE(rec->recovery_lock_handle); + if (rec->recovery_lock_handle == NULL) { + return; } + + D_NOTICE("Releasing recovery lock\n"); + TALLOC_FREE(rec->recovery_lock_handle); } static void ban_misbehaving_nodes(struct ctdb_recoverd *rec, bool *self_ban)