summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2019-03-12 13:27:34 +0530
committerAmar Tumballi <amarts@redhat.com>2019-03-13 10:50:10 +0000
commit67f48bfcc16a38052e6c9ae7c25e69b03b8ae008 (patch)
tree2cae0de77790bd54eeb38048eb2be85e7a62c048 /xlators/protocol
parenta395395e7fa16e12b3c3d9f9ba2a7bdbf4b50d74 (diff)
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 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/server/src/server.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 4fa6861..9cfc556 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -438,16 +438,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 */