From fbf2e9dfce3487c245715370abadd469a3bc744f Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Tue, 28 Aug 2012 13:12:31 +0530 Subject: glusterfsd: rpcsvc actors must return success after an attempt to submit reply rpcsvc attempts to send "error reply" using the req object. If actor has already performed rpcsvc_submit_generic, then req is destroyed. So if the actor returned -1 (RPCSVC_ACTOR_ERROR) on failing to submit reply, then req would be 'free'd' twice and will result in a crash eventually. Change-Id: I5eae19570202bbe5e154e9cb03390cfeb9b5f223 BUG: 851410 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/3863 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- glusterfsd/src/glusterfsd-mgmt.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 3006c66b7..b4cf6fd5b 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -223,8 +223,9 @@ glusterfs_translator_info_response_send (rpcsvc_request_t *req, int ret, if (!ret) free_ptr = _gf_true; - ret = glusterfs_submit_reply (req, &rsp, NULL, 0, NULL, - (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); + glusterfs_submit_reply (req, &rsp, NULL, 0, NULL, + (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); + ret = 0; if (free_ptr) GF_FREE (rsp.output.output_val); return ret; @@ -896,8 +897,9 @@ glusterfs_handle_brick_status (rpcsvc_request_t *req) goto out; } - ret = glusterfs_submit_reply (req, &rsp, NULL, 0, NULL, - (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); + glusterfs_submit_reply (req, &rsp, NULL, 0, NULL, + (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); + ret = 0; out: if (dict) @@ -1076,8 +1078,9 @@ glusterfs_handle_node_status (rpcsvc_request_t *req) goto out; } - ret = glusterfs_submit_reply (req, &rsp, NULL, 0, NULL, - (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); + glusterfs_submit_reply (req, &rsp, NULL, 0, NULL, + (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); + ret = 0; out: if (dict) @@ -1169,8 +1172,9 @@ glusterfs_handle_nfs_profile (rpcsvc_request_t *req) goto out; } - ret = glusterfs_submit_reply (req, &rsp, NULL, 0, NULL, - (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); + glusterfs_submit_reply (req, &rsp, NULL, 0, NULL, + (xdrproc_t)xdr_gd1_mgmt_brick_op_rsp); + ret = 0; out: free (nfs_req.input.input_val); -- cgit