From 1fc3aed7cf33b96f33693eee3c0551a0ab6a1f0f Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 15 Sep 2010 01:25:51 +0000 Subject: check if the peer is connected before updating friend and send response once befriended Signed-off-by: Raghavendra Bhat Signed-off-by: Vijay Bellur BUG: 1601 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1601 --- xlators/mgmt/glusterd/src/glusterd-sm.c | 2 +- xlators/mgmt/glusterd/src/glusterd3_1-mops.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c index a38d2fd8c..b1dc1ddac 100644 --- a/xlators/mgmt/glusterd/src/glusterd-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-sm.c @@ -511,7 +511,7 @@ glusterd_sm_t glusterd_state_befriended [] = { {GD_FRIEND_STATE_BEFRIENDED, glusterd_ac_none}, //EVENT_RCVD_LOCAL_ACC {GD_FRIEND_STATE_BEFRIENDED, glusterd_ac_none}, //EVENT_RCVD_RJT {GD_FRIEND_STATE_BEFRIENDED, glusterd_ac_none}, //EVENT_RCVD_LOCAL_RJT - {GD_FRIEND_STATE_BEFRIENDED, glusterd_ac_none}, //EVENT_RCV_FRIEND_REQ + {GD_FRIEND_STATE_BEFRIENDED, glusterd_ac_handle_friend_add_req}, //EVENT_RCV_FRIEND_REQ {GD_FRIEND_STATE_UNFRIEND_SENT, glusterd_ac_send_friend_remove_req}, //EVENT_INIT_REMOVE_FRIEND, {GD_FRIEND_STATE_DEFAULT, glusterd_ac_handle_friend_remove_req}, //EVENT_RCVD_REMOVE_FRIEND {GD_FRIEND_STATE_DEFAULT, glusterd_ac_friend_remove}, //EVENT_REMOVE_FRIEND diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c index f0d7931f9..a9dfa6d41 100644 --- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c +++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c @@ -888,6 +888,8 @@ glusterd3_1_friend_update (call_frame_t *frame, xlator_t *this, uuid_copy (req.uuid, priv->uuid); list_for_each_entry (peerinfo, &priv->peers, uuid_list) { + if (!peerinfo->connected) + continue; dummy_frame = create_frame (this, this->ctx->pool); ret = glusterd_submit_request (peerinfo, &req, dummy_frame, priv->mgmt, -- cgit