Patchwork [BUG:2023] mgmt/glusterd: update brick-count as soon as it is added in add-brick

login
register
Submitter Pranith K
Date 2010-10-27 10:40:19
Message ID <20101027104019.GA31817@dev.gluster.com>
Download mbox | patch
Permalink /patch/5583/
State Accepted
Delegated to: Anand Avati
Headers show

Comments

Pranith K - 2010-10-27 10:40:19
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
---
 xlators/mgmt/glusterd/src/glusterd-op-sm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 6341fd0..93eeb38 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1477,6 +1477,8 @@  glusterd_op_perform_add_bricks (glusterd_volinfo_t  *volinfo, int32_t count,
                 list_add_tail (&brickinfo->brick_list, &volinfo->bricks);
                 brick = strtok_r (NULL, " \n", &saveptr);
                 i++;
+                volinfo->brick_count++;
+
         }
 
         brick_list = gf_strdup (bricks);
@@ -1506,8 +1508,6 @@  glusterd_op_perform_add_bricks (glusterd_volinfo_t  *volinfo, int32_t count,
                 brick = strtok_r (NULL, " \n", &saveptr);
         }
 
-        volinfo->brick_count += count;
-
 out:
         if (free_ptr1)
                 GF_FREE (free_ptr1);