From c7a582818db71d50548a2cfce72ce9402ef5599a Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Tue, 12 Mar 2019 13:27:34 +0530 Subject: glusterfsd: Brick is getting crash at the time of startup Problem: Brick is getting crash because graph was not activated at the time of accessing server_conf Solution: To avoid the crash check ctx->active before processing a request > Change-Id: Ib112e0eace19189e45f430abdac5511c026bed47 > fixes: bz#1687705 >(cherry picked from commit 67f48bfcc16a38052e6c9ae7c25e69b03b8ae008) > (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/22339/) Change-Id: I1367c564f04edbad145575b811c67522cc318851 fixes: bz#1688218 Signed-off-by: Mohit Agrawal --- xlators/protocol/server/src/server.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xlators/protocol/server') diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 8b89e18d156..b4b447b34fc 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -436,16 +436,16 @@ server_rpc_notify(rpcsvc_t *rpc, void *xl, rpcsvc_event_t event, void *data) uint64_t xprtrefcount = 0; gf_boolean_t fd_exist = _gf_false; - if (!xl || !data) { + this = xl; + trans = data; + conf = this->private; + + if (!this || !data || !this->ctx || !this->ctx->active) { gf_msg_callingfn("server", GF_LOG_WARNING, 0, PS_MSG_RPC_NOTIFY_ERROR, "Calling rpc_notify without initializing"); goto out; } - this = xl; - trans = data; - conf = this->private; - switch (event) { case RPCSVC_EVENT_ACCEPT: { /* Have a structure per new connection */ -- cgit