summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-07-28 12:17:47 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-28 22:55:49 -0700
commitc9b709917b3d549d544133d51e85dbf9287278d1 (patch)
treea72414e7a59bc8c9f87644bd087219aef263a534 /xlators
parent40d3ad15856c88d93d16264aa1f6bb55806aafde (diff)
glusterd: Bug fixes in add/remove brick.
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1239 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1239
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 8016f93db..55533c118 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -785,7 +785,8 @@ glusterd_op_add_brick (gd1_mgmt_stage_op_req *req)
list_add_tail (&brickinfo->brick_list, &volinfo->bricks);
ret = glusterd_resolve_brick (brickinfo);
- if (!uuid_compare (brickinfo->uuid, priv->uuid)) {
+ if ((!uuid_compare (brickinfo->uuid, priv->uuid)) &&
+ (GLUSTERD_STATUS_STARTED == volinfo->status)) {
ret =
glusterd_volume_create_generate_volfiles (volinfo);
if (ret)
@@ -904,7 +905,8 @@ glusterd_op_remove_brick (gd1_mgmt_stage_op_req *req)
if (ret)
goto out;
- if (!uuid_compare (brickinfo->uuid, priv->uuid)) {
+ if ((!uuid_compare (brickinfo->uuid, priv->uuid)) &&
+ (GLUSTERD_STATUS_STARTED == volinfo->status)) {
ret =
glusterd_volume_create_generate_volfiles (volinfo);
if (ret)
@@ -920,11 +922,13 @@ glusterd_op_remove_brick (gd1_mgmt_stage_op_req *req)
"glusterfs, ret: %d", ret);
goto out;
}
- glusterd_brickinfo_delete (brickinfo);
glfs_stopped = _gf_true;
mybrick++;
}
+ glusterd_brickinfo_delete (brickinfo);
+ volinfo->brick_count--;
+
i++;
}