summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4renewd.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-08-06 01:03:31 +0200
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-08-06 01:22:22 +0200
commit8d480326c3d6921ff5f1cc988c993bd572248deb (patch)
treeeb2eac08a44bc78241d78291de545f37f6f3fd51 /fs/nfs/nfs4renewd.c
parentNFSv4: Cleanup the setting of the nfs4 lease period (diff)
downloadlinux-8d480326c3d6921ff5f1cc988c993bd572248deb.tar.xz
linux-8d480326c3d6921ff5f1cc988c993bd572248deb.zip
NFSv4: Cap the transport reconnection timer at 1/2 lease period
We don't want to miss a lease period renewal due to the TCP connection failing to reconnect in a timely fashion. To ensure this doesn't happen, cap the reconnection timer so that we retry the connection attempt at least every 1/2 lease period. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4renewd.c')
-rw-r--r--fs/nfs/nfs4renewd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/nfs4renewd.c b/fs/nfs/nfs4renewd.c
index 062029ab344a..82e77198d17e 100644
--- a/fs/nfs/nfs4renewd.c
+++ b/fs/nfs/nfs4renewd.c
@@ -151,6 +151,9 @@ void nfs4_set_lease_period(struct nfs_client *clp,
clp->cl_lease_time = lease;
clp->cl_last_renewal = lastrenewed;
spin_unlock(&clp->cl_lock);
+
+ /* Cap maximum reconnect timeout at 1/2 lease period */
+ rpc_cap_max_reconnect_timeout(clp->cl_rpcclient, lease >> 1);
}
/*