diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-07-28 12:17:47 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-28 22:55:49 -0700 |
commit | c9b709917b3d549d544133d51e85dbf9287278d1 (patch) | |
tree | a72414e7a59bc8c9f87644bd087219aef263a534 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | 40d3ad15856c88d93d16264aa1f6bb55806aafde (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/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 10 |
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 8016f93db2c..55533c1181e 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++; } |