Commit 5a88b391 authored by Trond Myklebust's avatar Trond Myklebust Committed by Jiri Slaby

SUNRPC: call_connect_status should recheck bind and connect status on error

commit 561ec160 upstream.

Currently, we go directly to call_transmit which sends us to call_status
on error. If we know that the connect attempt failed, we should rather
just jump straight back to call_bind and call_connect.

Ditto for EAGAIN, except do not delay.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent e204d37a
...@@ -1699,6 +1699,7 @@ call_connect_status(struct rpc_task *task) ...@@ -1699,6 +1699,7 @@ call_connect_status(struct rpc_task *task)
dprint_status(task); dprint_status(task);
trace_rpc_connect_status(task, status); trace_rpc_connect_status(task, status);
task->tk_status = 0;
switch (status) { switch (status) {
/* if soft mounted, test if we've timed out */ /* if soft mounted, test if we've timed out */
case -ETIMEDOUT: case -ETIMEDOUT:
...@@ -1707,12 +1708,14 @@ call_connect_status(struct rpc_task *task) ...@@ -1707,12 +1708,14 @@ call_connect_status(struct rpc_task *task)
case -ECONNREFUSED: case -ECONNREFUSED:
case -ECONNRESET: case -ECONNRESET:
case -ENETUNREACH: case -ENETUNREACH:
/* retry with existing socket, after a delay */
rpc_delay(task, 3*HZ);
if (RPC_IS_SOFTCONN(task)) if (RPC_IS_SOFTCONN(task))
break; break;
/* retry with existing socket, after a delay */
case 0:
case -EAGAIN: case -EAGAIN:
task->tk_status = 0; task->tk_action = call_bind;
return;
case 0:
clnt->cl_stats->netreconn++; clnt->cl_stats->netreconn++;
task->tk_action = call_transmit; task->tk_action = call_transmit;
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