From 4c9478b3604305e0e20c90096198b14dda83e3d0 Mon Sep 17 00:00:00 2001 From: Sanju Rakonde Date: Thu, 9 Nov 2017 13:15:51 +0530 Subject: glusterd: display gluster volume status, when quorum type is server Problem: when server-quorum-type is server, after restarting glusterd in the node which is up, gluster volume status is giving incorrect information. Fix: check whether server is blank, before adding other keys into the dictionary. Change-Id: I926ebdffab330ccef844f23f6d6556e137914047 BUG: 1511782 Signed-off-by: Sanju Rakonde (cherry picked from commit 046c7e3199fca715592762e271e6061ac99b0c4b) --- xlators/mgmt/glusterd/src/glusterd-utils.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index c4681b2486c..dbc8775e0d4 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -5031,6 +5031,12 @@ glusterd_add_node_to_dict (char *server, dict_t *dict, int count, * the brick as hostname+path, so this will make more sense * when output. */ + + if (!strcmp(server, "")) { + ret = 0; + goto out; + } + snprintf (key, sizeof (key), "brick%d.hostname", count); if (!strcmp (server, priv->nfs_svc.name)) ret = dict_set_str (dict, key, "NFS Server"); -- cgit