Commit be63d02c authored by Trond Myklebust's avatar Trond Myklebust Committed by Kamal Mostafa

SUNRPC: Ensure that call_connect times out correctly

commit 485f2251 upstream.

When the server is unavailable due to a networking error, etc, we want
the RPC client to respect the timeout delays when attempting to reconnect.
Reported-by: default avatarNeil Brown <neilb@suse.de>
Fixes: 561ec160 (SUNRPC: call_connect_status should recheck bind..)
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Cc: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 51b4d117
...@@ -1797,10 +1797,6 @@ call_connect_status(struct rpc_task *task) ...@@ -1797,10 +1797,6 @@ call_connect_status(struct rpc_task *task)
trace_rpc_connect_status(task, status); trace_rpc_connect_status(task, status);
task->tk_status = 0; task->tk_status = 0;
switch (status) { switch (status) {
/* if soft mounted, test if we've timed out */
case -ETIMEDOUT:
task->tk_action = call_timeout;
return;
case -ECONNREFUSED: case -ECONNREFUSED:
case -ECONNRESET: case -ECONNRESET:
case -ENETUNREACH: case -ENETUNREACH:
...@@ -1809,7 +1805,9 @@ call_connect_status(struct rpc_task *task) ...@@ -1809,7 +1805,9 @@ call_connect_status(struct rpc_task *task)
if (RPC_IS_SOFTCONN(task)) if (RPC_IS_SOFTCONN(task))
break; break;
case -EAGAIN: case -EAGAIN:
task->tk_action = call_bind; /* Check for timeouts before looping back to call_bind */
case -ETIMEDOUT:
task->tk_action = call_timeout;
return; return;
case 0: case 0:
clnt->cl_stats->netreconn++; clnt->cl_stats->netreconn++;
......
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