From 090c8866eb3ae174be50dec8d9d5ecf978d18a45 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Thu, 13 Apr 2017 13:20:18 +0530 Subject: 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. Change-Id: Icb820694034cbfcb3d427911e192ac4a0f4540f6 BUG: 1441910 Signed-off-by: Atin Mukherjee Reviewed-on: https://review.gluster.org/17055 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- 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 96446f0a225..91a4087c4b2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -4991,9 +4991,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: @@ -5432,13 +5429,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) @@ -5520,6 +5516,8 @@ glusterd_restart_bricks (glusterd_conf_t *conf) out: --(conf->blockers); conf->restart_done = _gf_true; + +return_block: return ret; } -- cgit