summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorSheetal Pamecha <spamecha@redhat.com>2020-09-23 17:41:46 +0530
committerSanju Rakonde <sanjurakonde@review.gluster.org>2020-09-24 12:49:15 +0000
commit3b8ee834a3b58780721e37767a274e7c9730eba0 (patch)
tree6466b135ebca159bf308d7f40c5154eb9ee05e5f /xlators/mgmt/glusterd/src
parenta65c3f7073cdcda45824aa8a3ca7f434faf87d25 (diff)
glusterd: Fix Add-brick with increasing replica count failure
Problem: add-brick operation fails with multiple bricks on same server error when replica count is increased. This was happening because of extra runs in a loop to compare hostnames and if bricks supplied were less than "replica" count, the bricks will get compared to itself resulting in above error. Fixes: #1508 Change-Id: I8668e964340b7bf59728bb838525d2db062197ed Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index b96838e..a204933 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -14818,6 +14818,10 @@ glusterd_check_brick_order(dict_t *dict, char *err_str, int32_t type,
i = 0;
ai_list_tmp1 = cds_list_entry(ai_list->list.next, addrinfo_list_t, list);
+ if (*brick_count < sub_count) {
+ sub_count = *brick_count;
+ }
+
/* Check for bad brick order */
while (i < *brick_count) {
++i;