From d516bed538bc09a77f94292de4bb4861da6ace54 Mon Sep 17 00:00:00 2001 From: Sakshi Bansal Date: Wed, 20 Jan 2016 09:31:00 +0530 Subject: glusterfsd: destroy frame after rebalance callback has completed Rebalance after sending a status notification immediately destroys the frame. Now in its callback the frame is corrupted. Rebalance crashes when this corrupted frame is accessed. To avoid this we must destroy the frame after the callback is completed. > Backport of http://review.gluster.org/#/c/13262/ > Change-Id: If383017a61f09275256e51c44a1efa28feace87b > BUG: 1300152 > Signed-off-by: Sakshi Change-Id: If383017a61f09275256e51c44a1efa28feace87b BUG: 1302962 Signed-off-by: Sakshi Reviewed-on: http://review.gluster.org/13317 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Raghavendra G --- glusterfsd/src/glusterfsd-mgmt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index c1ab934d31f..877adba2938 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -1834,6 +1834,11 @@ glusterfs_rebalance_event_notify_cbk (struct rpc_req *req, struct iovec *iov, } out: free (rsp.dict.dict_val); //malloced by xdr + + if (frame) { + STACK_DESTROY (frame->root); + } + return ret; } @@ -1870,9 +1875,6 @@ glusterfs_rebalance_event_notify (dict_t *dict) GF_FREE (req.dict.dict_val); - if (frame) { - STACK_DESTROY (frame->root); - } return ret; } -- cgit