Patchwork [BUG:1454] mgmt/glusterd: fixed volgen creation problems

login
register
Submitter Pranith K
Date 2010-08-30 11:22:27
Message ID <20100830112227.GA20052@dev.gluster.com>
Download mbox | patch
Permalink /patch/4385/
State Accepted
Delegated to: Anand Avati
Headers show

Comments

Pranith K - 2010-08-30 11:22:27
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
---
 xlators/mgmt/glusterd/src/glusterd-op-sm.c  |   12 +++---------
 xlators/mgmt/glusterd/src/glusterd-volgen.c |   12 ++----------
 2 files changed, 5 insertions(+), 19 deletions(-)

Patch

diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 20a5766..d8e5548 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1899,10 +1899,6 @@  glusterd_op_remove_brick (gd1_mgmt_stage_op_req *req)
 
                 if ((!uuid_compare (brickinfo->uuid, priv->uuid)) &&
                     (GLUSTERD_STATUS_STARTED == volinfo->status)) {
-                        ret = glusterd_create_volfiles (volinfo);
-                        if (ret)
-                                goto out;
-
                         gf_log ("", GF_LOG_NORMAL, "About to stop glusterfs"
                                 " for brick %s:%s", brickinfo->hostname,
                                 brickinfo->path);
@@ -1925,11 +1921,9 @@  glusterd_op_remove_brick (gd1_mgmt_stage_op_req *req)
                 i++;
         }
 
-        if (!glfs_stopped) {
-                ret = glusterd_create_volfiles (volinfo);
-                if (ret)
-                        goto out;
-        }
+        ret = glusterd_create_volfiles (volinfo);
+        if (ret)
+                goto out;
 
         volinfo->version++;
 
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index b8f2cb9..2f4ab6c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1365,23 +1365,15 @@  generate_client_volfile (glusterd_volinfo_t *volinfo, char *filename)
                 num_bricks++;
 
         if (GF_CLUSTER_TYPE_REPLICATE == volinfo->type) {
-                ret = dict_get_int32 (dict, "replica-count",
-                                      &replicate_count);
-                if (ret)
-                        goto out;
-
                 gf_log ("", GF_LOG_DEBUG,
                         "Volfile is distributed-replicated");
+                replicate_count = volinfo->sub_count;
                 dist_count = num_bricks / replicate_count;
 
         } else if (GF_CLUSTER_TYPE_STRIPE == volinfo->type) {
-                ret = dict_get_int32 (dict, "stripe-count",
-                                      &stripe_count);
-                if (ret)
-                        goto out;
-
                 gf_log ("", GF_LOG_DEBUG,
                         "Volfile is distributed-striped");
+                stripe_count = volinfo->sub_count;
                 dist_count = num_bricks / stripe_count;
         } else {
                 gf_log ("", GF_LOG_DEBUG,