diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-03-17 12:51:44 -0400 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-02-16 15:12:06 +0100 |
commit | 97034d21e60e27ff15f8caad7c101fdd29103651 (patch) | |
tree | 1649856787a859c6aa2a07d53ec393ba16730631 | |
parent | 51fedbbb1a7838732e8de08bec078c2e0066974a (diff) |
SUNRPC: Ensure that call_connect times out correctly
commit 485f2251782f7c44299c491d4676a8a01428d191 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: Neil Brown <neilb@suse.de>
Fixes: 561ec1603171 (SUNRPC: call_connect_status should recheck bind..)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r-- | net/sunrpc/clnt.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 21607ff675c1..9aa12c57f6a7 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1702,10 +1702,6 @@ call_connect_status(struct rpc_task *task) trace_rpc_connect_status(task, status); task->tk_status = 0; switch (status) { - /* if soft mounted, test if we've timed out */ - case -ETIMEDOUT: - task->tk_action = call_timeout; - return; case -ECONNREFUSED: case -ECONNRESET: case -ECONNABORTED: @@ -1716,7 +1712,9 @@ call_connect_status(struct rpc_task *task) if (RPC_IS_SOFTCONN(task)) break; case -EAGAIN: - task->tk_action = call_bind; + /* Check for timeouts before looping back to call_bind */ + case -ETIMEDOUT: + task->tk_action = call_timeout; return; case 0: clnt->cl_stats->netreconn++; |