diff options
author | Kinglong Mee <mijinlong@open-fs.com> | 2018-01-29 16:07:50 +0800 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2018-01-31 13:05:42 +0000 |
commit | 85f1d5444735c34ec8da23dc014ed99b6706577c (patch) | |
tree | f53abe70d5a31506f4c58970d9ab1c0f4723b2b3 | |
parent | 542af5714d761e787276111ca8bf7a5c69afb721 (diff) |
statedump: sanity check of mem_acct and rec for xlator
With memory accounting is disabled, glusterfs crash when doing statedump at,
0 0x00007fe24cff543a in gf_proc_dump_xlator_mem_info_only_in_use (xl=0x7fe23e44dc00) at statedump.c:269
1 0x00007fe24cff6310 in gf_proc_dump_oldgraph_xlator_info (top=0x7fe23e44dc00) at statedump.c:530
2 0x00007fe24cff7114 in gf_proc_dump_info (signum=10, ctx=0x7fe24ac0e000) at statedump.c:845
3 0x00007fe24d4d4bab in glusterfs_sigwaiter (arg=0x7ffc6c080750) at glusterfsd.c:2109
4 0x00007fe24bbd5dc5 in start_thread () from /lib64/libpthread.so.0
5 0x00007fe24b51a73d in clone () from /lib64/libc.so.6
(gdb) p xl->mem_acct
$1 = (struct mem_acct *) 0x0
(gdb) p xl->mem_acct->rec
$2 = 0x10
Change-Id: I10858170431311833ae01224d51c66caaad5e9a3
BUG: 1539603
Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
-rw-r--r-- | libglusterfs/src/statedump.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c index a2000b158e6..34b8061425c 100644 --- a/libglusterfs/src/statedump.c +++ b/libglusterfs/src/statedump.c @@ -227,7 +227,7 @@ gf_proc_dump_xlator_mem_info (xlator_t *xl) if (!xl) return; - if (!xl->mem_acct) + if (!xl->mem_acct || !xl->mem_acct->rec) return; gf_proc_dump_add_section ("%s.%s - Memory usage", xl->type, xl->name); @@ -262,7 +262,7 @@ gf_proc_dump_xlator_mem_info_only_in_use (xlator_t *xl) if (!xl) return; - if (!xl->mem_acct->rec) + if (!xl->mem_acct || !xl->mem_acct->rec) return; gf_proc_dump_add_section ("%s.%s - Memory usage", xl->type, xl->name); |