From 63a2ea7148ca58b4d2f0160d9c5b9bcf047c8c9e Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Garg Date: Wed, 10 Jun 2015 15:11:39 +0530 Subject: glusterd: subvol_count value for replicate volume should be calculate correctly glusterd was crashing while trying to remove bricks from replica set after shrinking nx3 replica to nx2 replica to nx1 replica. This is because volinfo->subvol_count is calculating value from old replica count value. Change-Id: I1084a71e29c9cfa1cd85bdb4e82b943b1dc44372 BUG: 1231646 Signed-off-by: Gaurav Kumar Garg Reviewed-on: http://review.gluster.org/11165 Reviewed-by: Atin Mukherjee Reviewed-by: Ravishankar N Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Krishnan Parthasarathi (cherry picked from commit 3fb18451311c34aeced1054472b6f81fc13dd679) Reviewed-on: http://review.gluster.org/11224 --- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 0af86f56854..b0cd2c1d890 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -2243,8 +2243,6 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) if (start_remove) volinfo->rebal.dict = dict_ref (bricks_dict); - volinfo->subvol_count = (volinfo->brick_count / - volinfo->dist_leaf_count); ret = dict_get_int32 (dict, "replica-count", &replica_count); if (!ret) { gf_log (this->name, GF_LOG_INFO, @@ -2273,6 +2271,8 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) } } } + volinfo->subvol_count = (volinfo->brick_count / + volinfo->dist_leaf_count); ret = glusterd_create_volfiles_and_notify_services (volinfo); if (ret) { -- cgit