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)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 2 Jul 2013 07:47:01 +0000 (17:47 +1000)
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 9a7227aee98281fdddddd36f2b3723289ae67f37..6fb3a38f47715dd8012793e8793cb5757268a25e 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;
 }