core: dereference check on the variables in glusterfs_handle_brick_status
problem: In a race condition, the active->first which is supposed to be filled is NULL and trying to dereference it crashs. back trace: Core was generated by `/usr/sbin/glusterfsd -s bxts470192.eu.rabonet.com --volfile-id prod_xvavol.bxts'. Program terminated with signal 11, Segmentation fault. 1029 any = active->first; (gdb) bt Change-Id: Ia6291865319a9456b8b01a5251be2679c4985b7c fixes: bz#1600451 Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
This commit is contained in:
parent
475826671a
commit
19e646f0b6
@ -1127,8 +1127,23 @@ glusterfs_handle_brick_status (rpcsvc_request_t *req)
|
||||
}
|
||||
|
||||
ctx = glusterfsd_ctx;
|
||||
GF_ASSERT (ctx);
|
||||
if (ctx == NULL) {
|
||||
gf_log (this->name, GF_LOG_ERROR, "ctx returned NULL");
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
if (ctx->active == NULL) {
|
||||
gf_log (this->name, GF_LOG_ERROR, "ctx->active returned NULL");
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
active = ctx->active;
|
||||
if (ctx->active->first == NULL) {
|
||||
gf_log (this->name, GF_LOG_ERROR, "ctx->active->first "
|
||||
"returned NULL");
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
server_xl = active->first;
|
||||
|
||||
brick_xl = get_xlator_by_name (server_xl, brickname);
|
||||
|
Loading…
x
Reference in New Issue
Block a user