From 751da4675cf3add21e567aebb92de2c10457afee Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Wed, 10 Oct 2012 10:23:37 +0530 Subject: glusterd: add-brick failed to start bricks when more than one were given Change-Id: I1487487a656e15e1a9a8685524ea40f0636e0e50 BUG: 864772 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/4051 Tested-by: Gluster Build System Reviewed-by: Kaushal M Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 5d59fadf3..d0a97b138 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -916,6 +916,14 @@ glusterd_op_perform_add_bricks (glusterd_volinfo_t *volinfo, int32_t count, volinfo->sub_count = ((volinfo->dist_leaf_count == 1) ? 0: volinfo->dist_leaf_count); + ret = glusterd_create_volfiles_and_notify_services (volinfo); + if (ret) + goto out; + + ret = 0; + if (GLUSTERD_STATUS_STARTED != volinfo->status) + goto out; + brick_list = gf_strdup (bricks); free_ptr2 = brick_list; i = 1; @@ -923,17 +931,16 @@ glusterd_op_perform_add_bricks (glusterd_volinfo_t *volinfo, int32_t count, if (count) brick = strtok_r (brick_list+1, " \n", &saveptr); - ret = glusterd_create_volfiles_and_notify_services (volinfo); - if (ret) - goto out; - while (i <= count) { - if (GLUSTERD_STATUS_STARTED == volinfo->status) { - ret = glusterd_brick_start (volinfo, brickinfo); - if (ret) - goto out; - } + ret = glusterd_volume_brickinfo_get_by_brick (brick, volinfo, + &brickinfo); + if (ret) + goto out; + + ret = glusterd_brick_start (volinfo, brickinfo); + if (ret) + goto out; i++; brick = strtok_r (NULL, " \n", &saveptr); } -- cgit