From ffc67d3fc64a016e9900bdb8b5fed5866850a1d8 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 Backport of http://review.gluster.org/14987 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 >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 Change-Id: Ib8bcc2fba908e88cf52b641c3f6bcba74f5e667c BUG: 1364329 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/15091 NetBSD-regression: NetBSD Build System Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Prashanth Pai Reviewed-by: Niels de Vos --- tests/bugs/core/bug-834465.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/bugs/core/bug-834465.t b/tests/bugs/core/bug-834465.t index e21e95393a6..996248d4116 100755 --- a/tests/bugs/core/bug-834465.t +++ b/tests/bugs/core/bug-834465.t @@ -33,8 +33,13 @@ build_tester $(dirname $0)/bug-834465.c TEST $(dirname $0)/bug-834465 $M0/testfile sdump2=$(generate_mount_statedump $V0); +nalloc2=0 +grep -A3 "fuse - usage-type gf_common_mt_fd_lk_ctx_node_t" $sdump2 +if [ $? -eq '0' ] +then + nalloc2=`grep -A3 "fuse - usage-type gf_common_mt_fd_lk_ctx_node_t" $sdump2 | grep -E "^num_allocs" | cut -d '=' -f2` +fi -nalloc2=`grep -A3 "fuse - usage-type gf_common_mt_fd_lk_ctx_node_t" $sdump2 | grep -E "^num_allocs" | cut -d '=' -f2` TEST [ $nalloc1 -eq $nalloc2 ]; TEST rm -rf $MOUNTDIR/* -- cgit