diff options
author | hujianfei <hujianfei@cmss.chinamobile.com> | 2019-02-15 04:07:46 -0500 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-03-04 03:38:08 +0000 |
commit | ea78c029a769e09fe2c9408f8b29b55f47141606 (patch) | |
tree | 8916b93230ff81e880b280dba7602f3adf8ab824 | |
parent | 06a65016f17452130d826baea5b3879122dc950e (diff) |
glusterfsd: Do not process PROFILE_NFS_INFO if graph is not ready
Otherwise, gnfs will crash in following situation.
Also see commit 2f9e555f.
Reproducible Steps:
1. kill gnfs process
2. service glusterd restart;gluster volume profile [vol] info nfs
dump trace info:
/lib64/libglusterfs.so.0(_gf_msg_backtrace_nomem+0xc2)[0x7fcf5cb6a872]
/lib64/libglusterfs.so.0(gf_print_trace+0x324)[0x7fcf5cb743a4]
/lib64/libc.so.6(+0x35670)[0x7fcf5b1d5670]
/usr/sbin/glusterfs(glusterfs_handle_nfs_profile+0x114)[0x7fcf5d066474]
/lib64/libglusterfs.so.0(synctask_wrap+0x12)[0x7fcf5cba1502]
/lib64/libc.so.6(+0x47110)[0x7fcf5b1e7110]
Fixes: bz#1684777
Change-Id: Id68edb3e4646c39544e0b4c90b5e0a9083b37b0d
Signed-off-by: hujianfei <hujianfei@cmss.chinamobile.com>
(cherry picked from commit 09394856e1197db4933e7e814589a3340eb739cd)
-rw-r--r-- | glusterfsd/src/glusterfsd-mgmt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index a78acb602a0..a6c3db5b551 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -1504,6 +1504,11 @@ glusterfs_handle_nfs_profile(rpcsvc_request_t *req) GF_ASSERT(ctx); active = ctx->active; + if (active == NULL) { + gf_log(THIS->name, GF_LOG_ERROR, "ctx->active returned NULL"); + ret = -1; + goto out; + } any = active->first; // is this needed? |