banning: No need to check if banned pnn is for local node
authorAmitay Isaacs <amitay@gmail.com>
Mon, 24 Jun 2013 04:33:32 +0000 (14:33 +1000)
committerMichael Adam <obnox@samba.org>
Mon, 26 Aug 2013 11:35:52 +0000 (13:35 +0200)
If the banned pnn is not the local node, the function returns early.
So no need for additional check.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 297d93cecc3c0655e72ecac38508e113bdbeab9c)

server/ctdb_banning.c

index 9195b820ae395c9091f3a28377f9c579a5f9f2f4..7931c2a3ade2729f0de46090fa5286165c857efc 100644 (file)
@@ -121,10 +121,8 @@ int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata)
        ctdb->nodes[bantime->pnn]->flags |= NODE_FLAGS_BANNED;
 
        event_add_timed(ctdb->ev, ctdb->banning_ctx, timeval_current_ofs(bantime->time,0), ctdb_ban_node_event, ctdb);
-       if (bantime->pnn == ctdb->pnn) {
-               ctdb_local_node_got_banned(ctdb);
-       }
 
+       ctdb_local_node_got_banned(ctdb);
        return 0;
 }