]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/sunrpc-tcp-reconnect
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / sunrpc-tcp-reconnect
CommitLineData
2cb7cef9
BS
1From: NeilBrown <neilb@suse.de>
2Subject: reset TCP connect timeout on successful connection.
3Patch-mainline: no - see below
4References: bnc#498708
5
6Currently, every time an NFS server closes a TCP connection, the
7client will double its time out (up to 300 seconds) before attempting
8to reconnect.
9The timeout should only double while it fails. On success it should
10reset the timeout.
11
12This patch resets the timeout on a successful connection.
13It also ensures that we the timeout it doubled, it does not remain at
140. This should fix a behaviour which has been observed where the
15client hammers on the server until it accepts a connection.
16
17Note: this has not been accepted upstream.
18The stated reason is that some (Netapp?) servers are prone to accept
19a connection and then drop it immediately. This would defeat the backoff.
20While this should be fixed there are complexities in getting it right,
21and the current patch is at least an improvement.
22(there where already cases where the client would retry at a high
23 rate and the new case is, I think, quite remote).
24When things are sorted out with upstream, we can get a better fix.
25
26Signed-off-by: NeilBrown <neilb@suse.de>
27
28---
29 net/sunrpc/xprtsock.c | 3 +++
30 1 file changed, 3 insertions(+)
31
32--- a/net/sunrpc/xprtsock.c
33+++ b/net/sunrpc/xprtsock.c
34@@ -1143,6 +1143,7 @@ static void xs_tcp_state_change(struct s
35 TCP_RCV_COPY_FRAGHDR | TCP_RCV_COPY_XID;
36
37 xprt_wake_pending_tasks(xprt, 0);
38+ xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
39 }
40 spin_unlock_bh(&xprt->transport_lock);
41 break;
42@@ -1785,6 +1786,8 @@ static void xs_connect(struct rpc_task *
43 &transport->connect_worker,
44 xprt->reestablish_timeout);
45 xprt->reestablish_timeout <<= 1;
46+ if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO)
47+ xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
48 if (xprt->reestablish_timeout > XS_TCP_MAX_REEST_TO)
49 xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO;
50 } else {