Blob Blame History Raw
From 17e56e6699ac4521da7144107d9f496437a76e6a Mon Sep 17 00:00:00 2001
From: Atin Mukherjee <amukherj@redhat.com>
Date: Thu, 13 Apr 2017 13:20:18 +0530
Subject: [PATCH 380/393] glusterd: fix glusterd_wait_for_blockers to go in
 infinite loop

In send_attach_req () conf->blockers is bumped up before
rpc_clnt_submit however the same is bumped down twice, one from the
callback and one from the negative ret handling which can very well be a
possible case if the rpc submit fails.

>Reviewed-on: https://review.gluster.org/17055
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>

Change-Id: Icb820694034cbfcb3d427911e192ac4a0f4540f6
BUG: 1441946
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/103636
---
 xlators/mgmt/glusterd/src/glusterd-utils.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 2adfb47..53ade93 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4978,9 +4978,6 @@ send_attach_req (xlator_t *this, struct rpc_clnt *rpc, char *path, int op)
         ret = rpc_clnt_submit (rpc, &gd_brick_prog, op,
                                my_callback, &iov, 1, NULL, 0, iobref,
                                frame, NULL, 0, NULL, 0, NULL);
-        if (ret) {
-                --(conf->blockers);
-        }
         return ret;
 
 free_iobref:
@@ -5419,13 +5416,12 @@ glusterd_restart_bricks (glusterd_conf_t *conf)
         gf_boolean_t          node_quorum    = _gf_false;
 
         this = THIS;
-        GF_VALIDATE_OR_GOTO ("glusterd", this, out);
+        GF_VALIDATE_OR_GOTO ("glusterd", this, return_block);
 
         conf = this->private;
-        GF_VALIDATE_OR_GOTO (this->name, conf, out);
+        GF_VALIDATE_OR_GOTO (this->name, conf, return_block);
 
         ++(conf->blockers);
-
         ret = glusterd_get_quorum_cluster_counts (this, &active_count,
                                                   &quorum_count);
         if (ret)
@@ -5507,6 +5503,8 @@ glusterd_restart_bricks (glusterd_conf_t *conf)
 out:
         --(conf->blockers);
         conf->restart_done = _gf_true;
+
+return_block:
         return ret;
 }
 
-- 
1.8.3.1