From: Trond Myklebust Date: Mon, 17 Mar 2014 16:51:44 +0000 (-0400) Subject: SUNRPC: Ensure that call_connect times out correctly X-Git-Tag: upstream/snapshot3+hdmi~2998 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1c6070174b2cd7fd218dd4cb24ae60d46c7e22b;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Fixes: 561ec1603171 (SUNRPC: call_connect_status should recheck bind..) Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 0edada9..5a1b8fa 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1798,10 +1798,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: @@ -1812,7 +1808,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++;