summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2016-09-13 05:57:32 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-09-15 08:43:08 -0700
commit36748550398f5e4a0bcdc603ac70a62453e86979 (patch)
tree46dd4c3739a459ecbbbca132757b7525ce48f6c5
parent957e40060734f1a0b2d9e3d37c4b0f7961f56b51 (diff)
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 <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/15482 Reviewed-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
-rw-r--r--xlators/protocol/client/src/client-rpc-fops.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
index ec900a6..b47d226 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);