summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-08-16 11:47:04 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-17 02:23:46 -0700
commit9eccb80f42328cff1e652b12e01a3b02898f5edf (patch)
tree2ff06dece9fdc947df5453c02c6e7d5302ef5e9b /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parent3af126d594c8e0710ba6a3fb4024224eb7f8e4b4 (diff)
glusterd: Fixes for add brick
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1374 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1374
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 0843bc25aa1..eb609e5ccb6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -892,9 +892,25 @@ glusterd_op_add_brick (gd1_mgmt_stage_op_req *req)
goto out;
list_add_tail (&brickinfo->brick_list, &volinfo->bricks);
+ brick = strtok_r (NULL, "\n", &saveptr);
+ i++;
+ }
+
+ brick_list = gf_strdup (bricks);
+ i = 1;
+
+ if (count)
+ brick = strtok_r (brick_list+1, " \n", &saveptr);
+
+ while (i <= count) {
+
+ ret = glusterd_brickinfo_get (brick, volinfo, &brickinfo);
+ if (ret)
+ goto out;
+
ret = glusterd_resolve_brick (brickinfo);
- if ((!uuid_compare (brickinfo->uuid, priv->uuid)) &&
+ if (!ret && (!uuid_compare (brickinfo->uuid, priv->uuid)) &&
(GLUSTERD_STATUS_STARTED == volinfo->status)) {
ret =
glusterd_volume_create_generate_volfiles (volinfo);
@@ -914,9 +930,8 @@ glusterd_op_add_brick (gd1_mgmt_stage_op_req *req)
glfs_started = _gf_true;
mybrick++;
}
-
- brick = strtok_r (NULL, " \n", &saveptr);
i++;
+ brick = strtok_r (NULL, "\n", &saveptr);
}
if (!glfs_started) {