From 9f2ad630c877b7b3fb833c89ad85dc10bcf552c4 Mon Sep 17 00:00:00 2001 From: Xie Changlong Date: Thu, 7 Nov 2019 17:35:45 +0800 Subject: gluster: check ctx->active To avoid process "TRANSLATOR INFO" "BARRIER" if graph is not ready, also see commit ee630e25. Updates: bz#1769712 Signed-off-by: Xie Changlong Change-Id: Ibd446a35962206d3689667cda7e6712d72e4ec2f --- glusterfsd/src/glusterfsd-mgmt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 43cc837f029..00d0e68fdd7 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -524,6 +524,11 @@ cont: 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; xlator = get_xlator_by_name(any, xlator_req.name); @@ -1834,6 +1839,11 @@ glusterfs_handle_barrier(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; + } top = active->first; for (trav = top->children; trav; trav = trav->next) { -- cgit