From f3dc620caaa7068ff12323a0001075140624733c Mon Sep 17 00:00:00 2001 From: Pranith K Date: Mon, 7 Mar 2011 04:38:35 +0000 Subject: mgmt/glusterd: reset pending count before sending the op Signed-off-by: Pranith Kumar K Signed-off-by: Anand V. Avati BUG: 2493 ([glusterfs-3.1.3qa4]: glusterd not reaching default state on errors) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2493 --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index c994db40c..2f6053ab8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -4595,6 +4595,7 @@ glusterd_op_ac_send_lock (glusterd_op_sm_event_t *event, void *ctx) glusterd_conf_t *priv = NULL; xlator_t *this = NULL; glusterd_peerinfo_t *peerinfo = NULL; + uint32_t pending_count = 0; this = THIS; priv = this->private; @@ -4614,10 +4615,11 @@ glusterd_op_ac_send_lock (glusterd_op_sm_event_t *event, void *ctx) ret = proc->fn (NULL, this, peerinfo); if (ret) continue; - opinfo.pending_count++; + pending_count++; } } + opinfo.pending_count = pending_count; if (!opinfo.pending_count) ret = glusterd_op_sm_inject_all_acc (); @@ -4634,6 +4636,7 @@ glusterd_op_ac_send_unlock (glusterd_op_sm_event_t *event, void *ctx) glusterd_conf_t *priv = NULL; xlator_t *this = NULL; glusterd_peerinfo_t *peerinfo = NULL; + uint32_t pending_count = 0; this = THIS; priv = this->private; @@ -4659,10 +4662,11 @@ glusterd_op_ac_send_unlock (glusterd_op_sm_event_t *event, void *ctx) ret = proc->fn (NULL, this, peerinfo); if (ret) continue; - opinfo.pending_count++; + pending_count++; } } + opinfo.pending_count = pending_count; if (!opinfo.pending_count) ret = glusterd_op_sm_inject_all_acc (); @@ -4826,6 +4830,7 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx) dict_t *dict = NULL; char *op_errstr = NULL; int i = 0; + uint32_t pending_count = 0; this = THIS; GF_ASSERT (this); @@ -4880,10 +4885,11 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx) ret = proc->fn (NULL, this, dict); if (ret) continue; - opinfo.pending_count++; + pending_count++; } } + opinfo.pending_count = pending_count; out: if (ret) { glusterd_op_sm_inject_event (GD_OP_EVENT_RCVD_RJT, NULL); @@ -4950,6 +4956,7 @@ glusterd_op_ac_send_commit_op (glusterd_op_sm_event_t *event, void *ctx) glusterd_peerinfo_t *peerinfo = NULL; char *op_errstr = NULL; int i = 0; + uint32_t pending_count = 0; this = THIS; GF_ASSERT (this); @@ -5000,10 +5007,11 @@ glusterd_op_ac_send_commit_op (glusterd_op_sm_event_t *event, void *ctx) ret = proc->fn (NULL, this, dict); if (ret) continue; - opinfo.pending_count++; + pending_count++; } } + opinfo.pending_count = pending_count; gf_log ("glusterd", GF_LOG_NORMAL, "Sent op req to %d peers", opinfo.pending_count); out: -- cgit