diff options
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r-- | net/sunrpc/xprtsock.c | 10 |
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(); |