Commit 1193d58f authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Backchannel handle socket nospace

If the socket was busy due to a socket nospace error, then we should
retry the send.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 88de6af2
...@@ -1951,24 +1951,22 @@ call_bc_transmit(struct rpc_task *task) ...@@ -1951,24 +1951,22 @@ call_bc_transmit(struct rpc_task *task)
{ {
struct rpc_rqst *req = task->tk_rqstp; struct rpc_rqst *req = task->tk_rqstp;
if (!xprt_prepare_transmit(task)) { if (!xprt_prepare_transmit(task))
/* goto out_retry;
* Could not reserve the transport. Try again after the
* transport is released.
*/
task->tk_status = 0;
task->tk_action = call_bc_transmit;
return;
}
task->tk_action = rpc_exit_task;
if (task->tk_status < 0) { if (task->tk_status < 0) {
printk(KERN_NOTICE "RPC: Could not send backchannel reply " printk(KERN_NOTICE "RPC: Could not send backchannel reply "
"error: %d\n", task->tk_status); "error: %d\n", task->tk_status);
return; goto out_done;
} }
if (req->rq_connect_cookie != req->rq_xprt->connect_cookie)
req->rq_bytes_sent = 0;
xprt_transmit(task); xprt_transmit(task);
if (task->tk_status == -EAGAIN)
goto out_nospace;
xprt_end_transmit(task); xprt_end_transmit(task);
dprint_status(task); dprint_status(task);
switch (task->tk_status) { switch (task->tk_status) {
...@@ -2002,6 +2000,13 @@ call_bc_transmit(struct rpc_task *task) ...@@ -2002,6 +2000,13 @@ call_bc_transmit(struct rpc_task *task)
break; break;
} }
rpc_wake_up_queued_task(&req->rq_xprt->pending, task); rpc_wake_up_queued_task(&req->rq_xprt->pending, task);
out_done:
task->tk_action = rpc_exit_task;
return;
out_nospace:
req->rq_connect_cookie = req->rq_xprt->connect_cookie;
out_retry:
task->tk_status = 0;
} }
#endif /* CONFIG_SUNRPC_BACKCHANNEL */ #endif /* CONFIG_SUNRPC_BACKCHANNEL */
......
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