aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-09-26 15:22:45 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-10-01 18:22:12 -0400
commit561ec1603171cd9b38dcf6cac53e8710f437a48d (patch)
treeecb67db63fee0218833abbfaf21f0778ec743112 /net/sunrpc
parent92551948174d079b12541437f51cbe3e17d9dd24 (diff)
SUNRPC: call_connect_status should recheck bind and connect status on error
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: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/clnt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index bde31159f632..7352aef8a254 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1692,6 +1692,7 @@ call_connect_status(struct rpc_task *task)
1692 dprint_status(task); 1692 dprint_status(task);
1693 1693
1694 trace_rpc_connect_status(task, status); 1694 trace_rpc_connect_status(task, status);
1695 task->tk_status = 0;
1695 switch (status) { 1696 switch (status) {
1696 /* if soft mounted, test if we've timed out */ 1697 /* if soft mounted, test if we've timed out */
1697 case -ETIMEDOUT: 1698 case -ETIMEDOUT:
@@ -1700,12 +1701,14 @@ call_connect_status(struct rpc_task *task)
1700 case -ECONNREFUSED: 1701 case -ECONNREFUSED:
1701 case -ECONNRESET: 1702 case -ECONNRESET:
1702 case -ENETUNREACH: 1703 case -ENETUNREACH:
1704 /* retry with existing socket, after a delay */
1705 rpc_delay(task, 3*HZ);
1703 if (RPC_IS_SOFTCONN(task)) 1706 if (RPC_IS_SOFTCONN(task))
1704 break; 1707 break;
1705 /* retry with existing socket, after a delay */
1706 case 0:
1707 case -EAGAIN: 1708 case -EAGAIN:
1708 task->tk_status = 0; 1709 task->tk_action = call_bind;
1710 return;
1711 case 0:
1709 clnt->cl_stats->netreconn++; 1712 clnt->cl_stats->netreconn++;
1710 task->tk_action = call_transmit; 1713 task->tk_action = call_transmit;
1711 return; 1714 return;