From 11055aacc820640f80ec876d32da3c7d0f0440ae Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Fri, 4 Mar 2016 15:04:13 +1100 Subject: [PATCH] ctdb-takeover: Do not kill smbd processes on releasing IP CTDB already notifies Samba with RELEASE_IP message. Samba can take appropriate action based on that. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12158 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke (cherry picked from commit b8272d835d6e5186568237cd8b7a2105884c0515) --- ctdb/server/ctdb_takeover.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index a613aa07008..b32772f88cd 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -815,44 +815,6 @@ int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb, return 0; } -/* - kill any clients that are registered with a IP that is being released - */ -static void release_kill_clients(struct ctdb_context *ctdb, ctdb_sock_addr *addr) -{ - struct ctdb_client_ip *ip; - - DEBUG(DEBUG_INFO,("release_kill_clients for ip %s\n", - ctdb_addr_to_str(addr))); - - for (ip=ctdb->client_ip_list; ip; ip=ip->next) { - ctdb_sock_addr tmp_addr; - - tmp_addr = ip->addr; - DEBUG(DEBUG_INFO,("checking for client %u with IP %s\n", - ip->client_id, - ctdb_addr_to_str(&ip->addr))); - - if (ctdb_same_ip(&tmp_addr, addr)) { - struct ctdb_client *client = reqid_find(ctdb->idr, - ip->client_id, - struct ctdb_client); - DEBUG(DEBUG_INFO,("matched client %u with IP %s and pid %u\n", - ip->client_id, - ctdb_addr_to_str(&ip->addr), - client->pid)); - - if (client->pid != 0) { - DEBUG(DEBUG_INFO,(__location__ " Killing client pid %u for IP %s on client_id %u\n", - (unsigned)client->pid, - ctdb_addr_to_str(addr), - ip->client_id)); - kill(client->pid, SIGKILL); - } - } - } -} - static void do_delete_ip(struct ctdb_context *ctdb, struct ctdb_vnn *vnn) { DLIST_REMOVE(ctdb->vnn, vnn); @@ -898,9 +860,6 @@ static void release_ip_callback(struct ctdb_context *ctdb, int status, ctdb_daemon_send_message(ctdb, ctdb->pnn, CTDB_SRVID_RELEASE_IP, data); - /* kill clients that have registered with this IP */ - release_kill_clients(ctdb, state->addr); - ctdb_vnn_unassign_iface(ctdb, state->vnn); /* Process the IP if it has been marked for deletion */ @@ -2415,7 +2374,6 @@ void ctdb_release_all_ips(struct ctdb_context *ctdb) ctdb_vnn_iface_string(vnn), ctdb_addr_to_str(&vnn->public_address), vnn->public_netmask_bits); - release_kill_clients(ctdb, &vnn->public_address); ctdb_vnn_unassign_iface(ctdb, vnn); vnn->update_in_flight = false; count++; -- 2.11.4.GIT