diff options
| author | Krishnan Parthasarathi <kparthas@redhat.com> | 2012-08-28 13:12:31 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vijay@gluster.com> | 2012-09-04 10:31:44 +0530 | 
| commit | 6f89a0f906921e43ab9979d680ee3c1425515b2c (patch) | |
| tree | 1a537c74d1e92ec7c30e883c54fa2b0b467d7598 | |
| parent | c67ed7068dfa07ef7090ff730baa4d85b906d359 (diff) | |
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 <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3863
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/3875
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
| -rw-r--r-- | glusterfsd/src/glusterfsd-mgmt.c | 20 | 
1 files changed, 12 insertions, 8 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 08aad9dc6e7..5f4fc617b65 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -229,8 +229,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; @@ -909,8 +910,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) @@ -1093,8 +1095,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) @@ -1191,8 +1194,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:          if (nfs_req.input.input_val)  | 
