From ee630e250fdc0081ae58c078ee5f5500561984df Mon Sep 17 00:00:00 2001 From: Hu Jianfei Date: Tue, 6 Nov 2018 06:47:08 -0500 Subject: 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 Signed-off-by: Hu Jianfei --- glusterfsd/src/glusterfsd-mgmt.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'glusterfsd') 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) -- cgit