From 80fa433be6e399311a6bcaa1e074bc1ae65122e2 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Fri, 5 Jul 2019 14:12:54 +0530 Subject: graph/shd: attach volfile even if ctx->active is NULL While we receive a graph attach request, if ctx->active is not set we used to fail assuming that the initilization has not completed yet for the process start. Since the management connection is established, it will receive attach request, even when ctx->active is NULL. Change-Id: Ied4d1ac63e6d4ced4a9405a78e1ce39f81dfd437 fixes: bz#1727256 Signed-off-by: Mohammed Rafi KC --- glusterfsd/src/glusterfsd-mgmt.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index fd3cc3368b3..1d097fb17f5 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -1088,14 +1088,12 @@ glusterfs_handle_svc_attach(rpcsvc_request_t *req) 0, }; xlator_t *this = NULL; - glusterfs_ctx_t *ctx = NULL; dict_t *dict = NULL; GF_ASSERT(req); this = THIS; GF_ASSERT(this); - ctx = this->ctx; ret = xdr_to_generic(req->msg[0], &xlator_req, (xdrproc_t)xdr_gd1_mgmt_brick_op_req); @@ -1128,14 +1126,9 @@ glusterfs_handle_svc_attach(rpcsvc_request_t *req) ret = 0; - if (ctx->active) { - ret = mgmt_process_volfile(xlator_req.input.input_val, - xlator_req.input.input_len, xlator_req.name, - dict); - } else { - gf_msg(this->name, GF_LOG_WARNING, EINVAL, glusterfsd_msg_42, - "got attach for %s but no active graph", xlator_req.name); - } + ret = mgmt_process_volfile(xlator_req.input.input_val, + xlator_req.input.input_len, xlator_req.name, + dict); out: if (dict) dict_unref(dict); @@ -1154,8 +1147,8 @@ glusterfs_handle_svc_detach(rpcsvc_request_t *req) 0, }; ssize_t ret; - glusterfs_ctx_t *ctx = NULL; gf_volfile_t *volfile_obj = NULL; + glusterfs_ctx_t *ctx = NULL; gf_volfile_t *volfile_tmp = NULL; ret = xdr_to_generic(req->msg[0], &xlator_req, -- cgit