From 049c91565dddb622b8902ccfeb36c0d414c609e1 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Tue, 31 May 2016 16:44:48 +0530 Subject: libglusterfs: fix glusterd statedump crash commit 3c04a91 removed setting typeStr to NULL if num_allocs is set to 0, this has caused this regression. Code has been put back like earlier and to avoid statedump printing all the NULL values check is modified to see skip the records if num_allocs is 0 instead of total_allocs Change-Id: Ib8bcc2fba908e88cf52b641c3f6bcba74f5e667c BUG: 1359190 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/14987 NetBSD-regression: NetBSD Build System Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: N Balachandran Reviewed-by: Prashanth Pai Reviewed-by: Jeff Darcy --- libglusterfs/src/statedump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libglusterfs/src/statedump.c') diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c index d4e7dbb3836..a292857fd10 100644 --- a/libglusterfs/src/statedump.c +++ b/libglusterfs/src/statedump.c @@ -234,7 +234,7 @@ gf_proc_dump_xlator_mem_info (xlator_t *xl) gf_proc_dump_write ("num_types", "%d", xl->mem_acct->num_types); for (i = 0; i < xl->mem_acct->num_types; i++) { - if (xl->mem_acct->rec[i].total_allocs == 0) + if (xl->mem_acct->rec[i].num_allocs == 0) continue; gf_proc_dump_add_section ("%s.%s - usage-type %s memusage", -- cgit