summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorHu Jianfei <hujianfei@cmss.chinamobile.com>2018-11-06 06:47:08 -0500
committerAmar Tumballi <amarts@redhat.com>2018-11-07 17:14:30 +0000
commitee630e250fdc0081ae58c078ee5f5500561984df (patch)
tree1134e984e11645e1d4f5b6340e28d1afefcbfc0f /glusterfsd
parentd945c44c6289eadcda805f728fcc638586658c37 (diff)
glusterfsd: Do not process GLUSTERD_NODE_STATUS if graph is not ready
Otherwise, gnfs will crash if we try to get nfs clients status in following situation. Also see commit 2f9e555f. Reproducible Steps: 1. systemctl restart glusterd; gluster volume status rep 2. systemctl restart glusterd; gluster volume status rep nfs clients step 1 works ok, but step 2 will lead localhost gnfs crash with certain probability. /lib64/libglusterfs.so.0(+0x270f0)[0x7effb6c7b0f0] /lib64/libglusterfs.so.0(gf_print_trace+0x334)[0x7effb6c854a4] /lib64/libc.so.6(+0x35270)[0x7effb52e7270] /usr/sbin/glusterfs(glusterfs_handle_node_status+0x155)[0x7effb7196905] /lib64/libglusterfs.so.0(+0x63f40)[0x7effb6cb7f40] /lib64/libc.so.6(+0x46d40)[0x7effb52f8d40] Updates: bz#1646869 Change-Id: Ia4cb009f821d32b2d18ba48d3467cc81a4b07747 Signed-off-by: Xie Changlong <xiechanglong@cmss.chinamobile.com> Signed-off-by: Hu Jianfei <hujianfei@cmss.chinamobile.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index 4339842768f..54b8215c967 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -1312,6 +1312,11 @@ glusterfs_handle_node_status(rpcsvc_request_t *req)
ctx = glusterfsd_ctx;
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;
if ((cmd & GF_CLI_STATUS_NFS) != 0)