Commit 8b39f2b4 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Ensure we exit early in case of an encode error

All errors from call_encode(), with exception of EAGAIN are fatal, so we
should immediately return instead of proceeding to xprt_transmit().
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 2116271a
...@@ -890,7 +890,6 @@ call_encode(struct rpc_task *task) ...@@ -890,7 +890,6 @@ call_encode(struct rpc_task *task)
task->tk_msg.rpc_argp); task->tk_msg.rpc_argp);
if (task->tk_status == -ENOMEM) { if (task->tk_status == -ENOMEM) {
/* XXX: Is this sane? */ /* XXX: Is this sane? */
rpc_delay(task, 3*HZ);
task->tk_status = -EAGAIN; task->tk_status = -EAGAIN;
} }
} }
...@@ -1048,9 +1047,15 @@ call_transmit(struct rpc_task *task) ...@@ -1048,9 +1047,15 @@ call_transmit(struct rpc_task *task)
BUG_ON(task->tk_rqstp->rq_bytes_sent != 0); BUG_ON(task->tk_rqstp->rq_bytes_sent != 0);
call_encode(task); call_encode(task);
/* Did the encode result in an error condition? */ /* Did the encode result in an error condition? */
if (task->tk_status != 0) if (task->tk_status != 0) {
/* Was the error nonfatal? */
if (task->tk_status == -EAGAIN)
rpc_delay(task, HZ >> 4);
else
rpc_exit(task, task->tk_status);
return; return;
} }
}
xprt_transmit(task); xprt_transmit(task);
if (task->tk_status < 0) if (task->tk_status < 0)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment