summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2019-07-05 14:12:54 +0530
committerAmar Tumballi <amarts@redhat.com>2019-08-05 06:48:20 +0000
commit80fa433be6e399311a6bcaa1e074bc1ae65122e2 (patch)
treeac1bd690cf533ed5efe4ef48ca40659f64ed26fc
parent8e47ae31e4477dc50eaf7604860ff8e7139ea547 (diff)
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 <rkavunga@redhat.com>
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c15
1 files 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,