diff options
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rpc-ops.c | 1 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-sm.c | 19 |
2 files changed, 10 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c index ef7a6a64807..1a10666c2db 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c @@ -508,6 +508,7 @@ glusterd3_1_friend_update_cbk (struct rpc_req *req, struct iovec *iov, goto out; } + ret = 0; out: gf_log (this->name, GF_LOG_INFO, "Received %s from uuid: %s", (ret)?"RJT":"ACC", uuid_utoa (rsp.uuid)); diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c index 5376c5b6b08..72af8c05b57 100644 --- a/xlators/mgmt/glusterd/src/glusterd-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-sm.c @@ -445,19 +445,15 @@ out: } static gf_boolean_t -glusterd_is_valid_recipient_peer (glusterd_peerinfo_t *peerinfo, - glusterd_peerinfo_t *cur_peerinfo) +glusterd_should_update_peer (glusterd_peerinfo_t *peerinfo, + glusterd_peerinfo_t *cur_peerinfo) { gf_boolean_t is_valid = _gf_false; - if (peerinfo == cur_peerinfo) + if ((peerinfo == cur_peerinfo) || + (peerinfo->state.state == GD_FRIEND_STATE_BEFRIENDED)) is_valid = _gf_true; - else if (peerinfo->connected && peerinfo->peer && - peerinfo->state.state == GD_FRIEND_STATE_BEFRIENDED) - is_valid = _gf_true; - - return is_valid; } @@ -496,7 +492,7 @@ glusterd_ac_send_friend_update (glusterd_friend_sm_event_t *event, void *ctx) goto out; list_for_each_entry (peerinfo, &priv->peers, uuid_list) { - if (!glusterd_is_valid_recipient_peer (peerinfo, cur_peerinfo)) + if (!glusterd_should_update_peer (peerinfo, cur_peerinfo)) continue; count++; @@ -518,7 +514,10 @@ glusterd_ac_send_friend_update (glusterd_friend_sm_event_t *event, void *ctx) goto out; list_for_each_entry (peerinfo, &priv->peers, uuid_list) { - if (!glusterd_is_valid_recipient_peer (peerinfo, cur_peerinfo)) + if (!peerinfo->connected || !peerinfo->peer) + continue; + + if (!glusterd_should_update_peer (peerinfo, cur_peerinfo)) continue; ret = dict_set_static_ptr (friends, "peerinfo", peerinfo); |