From 846383acb963b9c74a386192bb5050a9366a8036 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Mon, 4 Oct 2010 11:19:23 +0000 Subject: mgmt/glusterd: cleanup during detach Signed-off-by: Vijay Bellur Signed-off-by: Vijay Bellur BUG: 1765 (peer probe on removed-detached bricks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1765 --- xlators/mgmt/glusterd/src/glusterd-sm.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c index 268ccaff42e..2e872bb8afa 100644 --- a/xlators/mgmt/glusterd/src/glusterd-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-sm.c @@ -394,24 +394,32 @@ glusterd_ac_handle_friend_remove_req (glusterd_friend_sm_event_t *event, glusterd_peerinfo_t *peerinfo = NULL; glusterd_friend_req_ctx_t *ev_ctx = NULL; glusterd_friend_sm_event_t *new_event = NULL; + glusterd_conf_t *priv = NULL; GF_ASSERT (ctx); ev_ctx = ctx; peerinfo = event->peerinfo; GF_ASSERT (peerinfo); + priv = THIS->private; + GF_ASSERT (priv); + ret = glusterd_xfer_friend_remove_resp (ev_ctx->req, ev_ctx->hostname, ev_ctx->port); - ret = glusterd_friend_sm_new_event (GD_FRIEND_EVENT_REMOVE_FRIEND, - &new_event); + list_for_each_entry (peerinfo, &priv->peers, uuid_list) { - if (ret) - goto out; + ret = glusterd_friend_sm_new_event (GD_FRIEND_EVENT_REMOVE_FRIEND, + &new_event); + if (ret) + goto out; - new_event->peerinfo = peerinfo; + new_event->peerinfo = peerinfo; - ret = glusterd_friend_sm_inject_event (new_event); + ret = glusterd_friend_sm_inject_event (new_event); + if (ret) + goto out; + } out: gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret); -- cgit