Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=663b8858dddbc8e634476960cc1c5f69dadba9b0
Commit:     663b8858dddbc8e634476960cc1c5f69dadba9b0
Parent:     62da3b24880bccd4ffc32cf8d9a7e23fab475bdd
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 1 18:42:12 2008 -0500
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 02:05:27 2008 -0500

    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 <[EMAIL PROTECTED]>
---
 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 741ab8a..a4cfdc5 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1130,13 +1130,13 @@ static void xs_tcp_state_change(struct sock *sk)
                        transport->tcp_flags =
                                TCP_RCV_COPY_FRAGHDR | TCP_RCV_COPY_XID;
 
-                       xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
                        xprt_wake_pending_tasks(xprt, 0);
                }
                spin_unlock_bh(&xprt->transport_lock);
                break;
        case TCP_FIN_WAIT1:
                /* The client initiated a shutdown of the socket */
+               xprt->reestablish_timeout = 0;
                set_bit(XPRT_CLOSING, &xprt->state);
                smp_mb__before_clear_bit();
                clear_bit(XPRT_CONNECTED, &xprt->state);
@@ -1147,6 +1147,14 @@ static void xs_tcp_state_change(struct sock *sk)
                /* The server initiated a shutdown of the socket */
                set_bit(XPRT_CLOSING, &xprt->state);
                xprt_force_disconnect(xprt);
+       case TCP_SYN_SENT:
+       case TCP_CLOSING:
+               /*
+                * If the server closed down the connection, make sure that
+                * we back off before reconnecting
+                */
+               if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO)
+                       xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
                break;
        case TCP_LAST_ACK:
                smp_mb__before_clear_bit();
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to