From 5e937c4ed16a7658628a3ce6e5d39832ec516bac Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Thu, 6 Dec 2012 16:49:04 +0530 Subject: Fix xdr_to_generic success check This patch fixes the success check for xdr_to_generic function across the codebase. Also, cleans up the brick_op actors table in glusterfsd-mgmt.c to make sure that the actors are called directly by rpcsvc. Change-Id: I3086585f30c44f69f1bc83665f89e30025f76d3a BUG: 884452 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/4278 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-handshake.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-handshake.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c index 428051d4a..7a2075974 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handshake.c +++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c @@ -126,8 +126,9 @@ server_getspec (rpcsvc_request_t *req) char addrstr[RPCSVC_PEER_STRLEN] = {0}; - if (!xdr_to_generic (req->msg[0], &args, - (xdrproc_t)xdr_gf_getspec_req)) { + ret = xdr_to_generic (req->msg[0], &args, + (xdrproc_t)xdr_gf_getspec_req); + if (ret < 0) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto fail; @@ -219,8 +220,9 @@ server_event_notify (rpcsvc_request_t *req) dict_t *dict = NULL; gf_boolean_t need_rsp = _gf_true; - if (!xdr_to_generic (req->msg[0], &args, - (xdrproc_t)xdr_gf_event_notify_req)) { + ret = xdr_to_generic (req->msg[0], &args, + (xdrproc_t)xdr_gf_event_notify_req); + if (ret < 0) { req->rpc_err = GARBAGE_ARGS; goto fail; } @@ -315,8 +317,9 @@ glusterd_mgmt_hndsk_versions (rpcsvc_request_t *req) this = THIS; conf = this->private; - if (!xdr_to_generic (req->msg[0], &args, - (xdrproc_t)xdr_gf_mgmt_hndsk_req)) { + ret = xdr_to_generic (req->msg[0], &args, + (xdrproc_t)xdr_gf_mgmt_hndsk_req); + if (ret < 0) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -391,8 +394,9 @@ glusterd_mgmt_hndsk_versions_ack (rpcsvc_request_t *req) this = THIS; conf = this->private; - if (!xdr_to_generic (req->msg[0], &args, - (xdrproc_t)xdr_gf_mgmt_hndsk_req)) { + ret = xdr_to_generic (req->msg[0], &args, + (xdrproc_t)xdr_gf_mgmt_hndsk_req); + if (ret < 0) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; -- cgit