summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-statedump.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-statedump.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-statedump.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-statedump.c b/xlators/mgmt/glusterd/src/glusterd-statedump.c
index 7f806023566..d0a97053485 100644
--- a/xlators/mgmt/glusterd/src/glusterd-statedump.c
+++ b/xlators/mgmt/glusterd/src/glusterd-statedump.c
@@ -239,18 +239,23 @@ glusterd_dump_priv (xlator_t *this)
/* Dump pmap data structure from base port to last alloc */
pmap = priv->pmap;
- for (port = pmap->base_port; port <= pmap->last_alloc;
- port++) {
- gf_proc_dump_build_key (key, "glusterd", "pmap_port");
- gf_proc_dump_write (key, "%d", port);
- gf_proc_dump_build_key (key, "glusterd",
- "pmap[%d].type", port);
- gf_proc_dump_write (key, "%d", pmap->ports[port].type);
- gf_proc_dump_build_key (key, "glusterd",
- "pmap[%d].brickname", port);
- gf_proc_dump_write (key, "%s",
- pmap->ports[port].brickname);
-
+ if (pmap) {
+ for (port = pmap->base_port; port <= pmap->last_alloc;
+ port++) {
+ gf_proc_dump_build_key (key, "glusterd",
+ "pmap_port");
+ gf_proc_dump_write (key, "%d", port);
+ gf_proc_dump_build_key (key, "glusterd",
+ "pmap[%d].type", port);
+ gf_proc_dump_write (key, "%d",
+ pmap->ports[port].type);
+ gf_proc_dump_build_key (key, "glusterd",
+ "pmap[%d].brickname",
+ port);
+ gf_proc_dump_write (key, "%s",
+ pmap->ports[port].brickname);
+
+ }
}
/* Dump client details */
glusterd_dump_client_details (priv);