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>
This commit is contained in:
parent
542af5714d
commit
85f1d54447
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user