Commit 561ec1603171cd9b38dcf6cac53e8710f437a48d

Authored by Trond Myklebust
1 parent 9255194817

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>

Showing 1 changed file with 6 additions and 3 deletions Side-by-side Diff

... ... @@ -1692,6 +1692,7 @@
1692 1692 dprint_status(task);
1693 1693  
1694 1694 trace_rpc_connect_status(task, status);
  1695 + task->tk_status = 0;
1695 1696 switch (status) {
1696 1697 /* if soft mounted, test if we've timed out */
1697 1698 case -ETIMEDOUT:
1698 1699  
1699 1700  
... ... @@ -1700,12 +1701,14 @@
1700 1701 case -ECONNREFUSED:
1701 1702 case -ECONNRESET:
1702 1703 case -ENETUNREACH:
  1704 + /* retry with existing socket, after a delay */
  1705 + rpc_delay(task, 3*HZ);
1703 1706 if (RPC_IS_SOFTCONN(task))
1704 1707 break;
1705   - /* retry with existing socket, after a delay */
1706   - case 0:
1707 1708 case -EAGAIN:
1708   - task->tk_status = 0;
  1709 + task->tk_action = call_bind;
  1710 + return;
  1711 + case 0:
1709 1712 clnt->cl_stats->netreconn++;
1710 1713 task->tk_action = call_transmit;
1711 1714 return;