From 24d09edf4b13d72a8707c801939921de0d32d4dd Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Tue, 27 Jun 2017 21:09:49 +0530 Subject: glusterd: mark brickinfo to started on successful attach brickinfo's port & status should be filled up only when attach brick is successful. Change-Id: I68b181be37cb94d176f0f4692e8d9dac5493181c BUG: 1465559 Signed-off-by: Atin Mukherjee Reviewed-on: https://review.gluster.org/17640 Reviewed-by: Jeff Darcy Smoke: Gluster Build System Reviewed-by: Samikshan Bairagya CentOS-regression: Gluster Build System --- xlators/mgmt/glusterd/src/glusterd-utils.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index f0c12315160..7e50d597fc2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -5076,11 +5076,6 @@ attach_brick (xlator_t *this, "adding brick to process failed"); return -1; } - - brickinfo->port = other_brick->port; - brickinfo->status = GF_BRICK_STARTED; - brickinfo->rpc = rpc_clnt_ref (other_brick->rpc); - GLUSTERD_GET_BRICK_PIDFILE (pidfile1, other_vol, other_brick, conf); GLUSTERD_GET_BRICK_PIDFILE (pidfile2, volinfo, brickinfo, conf); @@ -5106,6 +5101,10 @@ attach_brick (xlator_t *this, successfully */ glusterd_copy_file (pidfile1, pidfile2); + brickinfo->port = other_brick->port; + brickinfo->status = GF_BRICK_STARTED; + brickinfo->rpc = + rpc_clnt_ref (other_brick->rpc); return 0; } } -- cgit