From 36748550398f5e4a0bcdc603ac70a62453e86979 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Tue, 13 Sep 2016 05:57:32 -0400 Subject: protocol/client: fix op_errno handling, was unused variable see comment in patch set one. Match the general logic flow of the other fop-cbks and eliminate the unused variable and its associated warning also see comment in patch set seven, re: correct handling of client_process_response(); and the associated BZ https://bugzilla.redhat.com/show_bug.cgi?id=1376328 http://review.gluster.org/14085 fixes a "pragma leak" where the generated rpc/xdr headers have a pair of pragmas that disable these warnings. With the warnings disabled, many unused variables have crept into the code base. And 14085 won't pass its own smoke test until all these warnings are fixed. BUG: 1369124 Change-Id: I7421ba3550770acc5564b7d6aba3290e027591f2 Signed-off-by: Kaleb S. KEITHLEY Reviewed-on: http://review.gluster.org/15482 Reviewed-by: Niels de Vos Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/protocol/client/src/client-rpc-fops.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'xlators/protocol/client') diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c index ec900a6700d..b47d2268391 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -3153,7 +3153,6 @@ client3_3_compound_cbk (struct rpc_req *req, struct iovec *iov, int count, xlator_t *this = NULL; dict_t *xdata = NULL; clnt_local_t *local = NULL; - int op_errno = 0; int i,length = 0; int ret = -1; @@ -3163,7 +3162,8 @@ client3_3_compound_cbk (struct rpc_req *req, struct iovec *iov, int count, local = frame->local; if (-1 == req->rpc_status) { - op_errno = ENOTCONN; + rsp.op_ret = -1; + rsp.op_errno = ENOTCONN; goto out; } @@ -3171,7 +3171,8 @@ client3_3_compound_cbk (struct rpc_req *req, struct iovec *iov, int count, if (ret < 0) { gf_msg (this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed"); - op_errno = EINVAL; + rsp.op_ret = -1; + rsp.op_errno = EINVAL; goto out; } @@ -3183,21 +3184,31 @@ client3_3_compound_cbk (struct rpc_req *req, struct iovec *iov, int count, args_cbk = compound_args_cbk_alloc (length, xdata); if (!args_cbk) { - op_errno = ENOMEM; + rsp.op_ret = -1; + rsp.op_errno = ENOMEM; goto out; } + /* TODO: see https://bugzilla.redhat.com/show_bug.cgi?id=1376328 */ for (i = 0; i < args_cbk->fop_length; i++) { ret = client_process_response (frame, this, req, &rsp, args_cbk, i); if (ret) { - op_errno = -ret; + rsp.op_ret = -1; + rsp.op_errno = -ret; goto out; } } rsp.op_ret = 0; out: + if (rsp.op_ret == -1) { + gf_msg (this->name, GF_LOG_WARNING, + gf_error_to_errno (rsp.op_errno), + PC_MSG_REMOTE_OP_FAILED, + "remote operation failed"); + } + CLIENT_STACK_UNWIND (compound, frame, rsp.op_ret, gf_error_to_errno (rsp.op_errno), args_cbk, xdata); -- cgit