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