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)
This commit is contained in:
hujianfei 2019-02-15 04:07:46 -05:00 committed by Amar Tumballi
parent 06a65016f1
commit ea78c029a7

View File

@ -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?