aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-01 18:42:12 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:27 -0500
commit663b8858dddbc8e634476960cc1c5f69dadba9b0 (patch)
tree9e6b9408cd9483dea7553bd8eba58fa449ec9d85 /net
parent62da3b24880bccd4ffc32cf8d9a7e23fab475bdd (diff)
SUNRPC: Reconnect immediately whenever the server isn't refusing it.
If we've disconnected from the server, rather than the other way round, then it makes little sense to wait 3 seconds before reconnecting. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xprtsock.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 741ab8ad1f3a..a4cfdc5b2648 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1130,13 +1130,13 @@ static void xs_tcp_state_change(struct sock *sk)
1130 transport->tcp_flags = 1130 transport->tcp_flags =
1131 TCP_RCV_COPY_FRAGHDR | TCP_RCV_COPY_XID; 1131 TCP_RCV_COPY_FRAGHDR | TCP_RCV_COPY_XID;
1132 1132
1133 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
1134 xprt_wake_pending_tasks(xprt, 0); 1133 xprt_wake_pending_tasks(xprt, 0);
1135 } 1134 }
1136 spin_unlock_bh(&xprt->transport_lock); 1135 spin_unlock_bh(&xprt->transport_lock);
1137 break; 1136 break;
1138 case TCP_FIN_WAIT1: 1137 case TCP_FIN_WAIT1:
1139 /* The client initiated a shutdown of the socket */ 1138 /* The client initiated a shutdown of the socket */
1139 xprt->reestablish_timeout = 0;
1140 set_bit(XPRT_CLOSING, &xprt->state); 1140 set_bit(XPRT_CLOSING, &xprt->state);
1141 smp_mb__before_clear_bit(); 1141 smp_mb__before_clear_bit();
1142 clear_bit(XPRT_CONNECTED, &xprt->state); 1142 clear_bit(XPRT_CONNECTED, &xprt->state);
@@ -1147,6 +1147,14 @@ static void xs_tcp_state_change(struct sock *sk)
1147 /* The server initiated a shutdown of the socket */ 1147 /* The server initiated a shutdown of the socket */
1148 set_bit(XPRT_CLOSING, &xprt->state); 1148 set_bit(XPRT_CLOSING, &xprt->state);
1149 xprt_force_disconnect(xprt); 1149 xprt_force_disconnect(xprt);
1150 case TCP_SYN_SENT:
1151 case TCP_CLOSING:
1152 /*
1153 * If the server closed down the connection, make sure that
1154 * we back off before reconnecting
1155 */
1156 if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO)
1157 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
1150 break; 1158 break;
1151 case TCP_LAST_ACK: 1159 case TCP_LAST_ACK:
1152 smp_mb__before_clear_bit(); 1160 smp_mb__before_clear_bit();