summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd-mgmt.c
diff options
context:
space:
mode:
authorXie Changlong <xiechanglong@cmss.chinamobile.com>2019-11-07 17:35:45 +0800
committerAmar Tumballi <amarts@gmail.com>2019-11-12 14:08:36 +0000
commit9f2ad630c877b7b3fb833c89ad85dc10bcf552c4 (patch)
treea2315f6a86f936e2e6240885c9baae9d12088999 /glusterfsd/src/glusterfsd-mgmt.c
parent45e8ddf6acebaf8c178b432024ab82288b54288f (diff)
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 <xiechanglong@cmss.chinamobile.com> Change-Id: Ibd446a35962206d3689667cda7e6712d72e4ec2f
Diffstat (limited to 'glusterfsd/src/glusterfsd-mgmt.c')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c10
1 files changed, 10 insertions, 0 deletions
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) {