e3c68b
From 167980565e1ab56989b25fe6aa0203aeb7970c8b Mon Sep 17 00:00:00 2001
e3c68b
From: Sanju Rakonde <srakonde@redhat.com>
e3c68b
Date: Sun, 6 Oct 2019 19:05:28 +0530
e3c68b
Subject: [PATCH 306/307] cli: fix distCount value
e3c68b
e3c68b
gluster volume info --xml id displaying wrong distCount
e3c68b
value. This patch addresses it.
e3c68b
e3c68b
> fixes: bz#1758878
e3c68b
> Change-Id: I64081597e06018361e6524587b433b0c4b2a0260
e3c68b
> Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
e3c68b
e3c68b
upstream patch: https://review.gluster.org/#/c/glusterfs/+/23521/
e3c68b
e3c68b
BUG: 1758618
e3c68b
Change-Id: I64081597e06018361e6524587b433b0c4b2a0260
e3c68b
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
e3c68b
Reviewed-on: https://code.engineering.redhat.com/gerrit/183147
e3c68b
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e3c68b
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e3c68b
---
e3c68b
 cli/src/cli-xml-output.c | 5 +++--
e3c68b
 1 file changed, 3 insertions(+), 2 deletions(-)
e3c68b
e3c68b
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
e3c68b
index b417bb8..006e2fb 100644
e3c68b
--- a/cli/src/cli-xml-output.c
e3c68b
+++ b/cli/src/cli-xml-output.c
e3c68b
@@ -2548,8 +2548,9 @@ cli_xml_output_vol_info(cli_local_t *local, dict_t *dict)
e3c68b
         ret = dict_get_int32(dict, key, &dist_count);
e3c68b
         if (ret)
e3c68b
             goto out;
e3c68b
-        ret = xmlTextWriterWriteFormatElement(
e3c68b
-            local->writer, (xmlChar *)"distCount", "%d", dist_count);
e3c68b
+        ret = xmlTextWriterWriteFormatElement(local->writer,
e3c68b
+                                              (xmlChar *)"distCount", "%d",
e3c68b
+                                              (brick_count / dist_count));
e3c68b
         XML_RET_CHECK_AND_GOTO(ret, out);
e3c68b
 
e3c68b
         snprintf(key, sizeof(key), "volume%d.stripe_count", i);
e3c68b
-- 
e3c68b
1.8.3.1
e3c68b