mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-daemon: Drop handling of ban control sent to unexpected node
The banning code caters for the case where the node specified in the bantime data is not the node receiving the control. This never happens. There are 2 places where ctdb_ctrl_set_ban() is called: the ctdb CLI tool and the recovery daemon. Both pass the same node in the bantime data that they are sending the control to. There are no plans to do anything more elaborate, so just delete the handling of this special case. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
e153501474
commit
ad6685847b
@ -87,27 +87,10 @@ int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata)
|
||||
DEBUG(DEBUG_INFO,("SET BAN STATE\n"));
|
||||
|
||||
if (bantime->pnn != ctdb->pnn) {
|
||||
if (bantime->pnn >= ctdb->num_nodes) {
|
||||
DEBUG(DEBUG_ERR,(__location__ " ERROR: Invalid ban request. PNN:%d is invalid. Max nodes %d\n", bantime->pnn, ctdb->num_nodes));
|
||||
return -1;
|
||||
}
|
||||
if (bantime->time == 0) {
|
||||
DEBUG(DEBUG_NOTICE,("unbanning node %d\n", bantime->pnn));
|
||||
ctdb->nodes[bantime->pnn]->flags &= ~NODE_FLAGS_BANNED;
|
||||
} else {
|
||||
DEBUG(DEBUG_NOTICE,("banning node %d\n", bantime->pnn));
|
||||
if (ctdb->tunable.enable_bans == 0) {
|
||||
/* FIXME: This is bogus. We really should be
|
||||
* taking decision based on the tunables on
|
||||
* the banned node and not local node.
|
||||
*/
|
||||
DEBUG(DEBUG_WARNING,("Bans are disabled - ignoring ban of node %u\n", bantime->pnn));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ctdb->nodes[bantime->pnn]->flags |= NODE_FLAGS_BANNED;
|
||||
}
|
||||
return 0;
|
||||
DEBUG(DEBUG_WARNING,
|
||||
("SET_BAN_STATE control for PNN %d ignored\n",
|
||||
bantime->pnn));
|
||||
return -1;
|
||||
}
|
||||
|
||||
already_banned = false;
|
||||
|
Loading…
Reference in New Issue
Block a user