]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-recoverd: Return early when the recovery lock is not held
authorMartin Schwenke <martin@meltin.net>
Tue, 11 Sep 2018 05:05:19 +0000 (15:05 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 17 Sep 2018 20:58:20 +0000 (22:58 +0200)
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recoverd.c

index 46357b6ed690905ae2fe05f39b566397f473495f..6a02110153578c7a9331a80e6ed6f0321e90b071 100644 (file)
@@ -976,10 +976,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)