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