diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-03 09:55:24 +0100 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-06 14:58:46 -0500 |
commit | 58d9714a44a79bba9b414da3ffbf3c753dc5915f (patch) | |
tree | 623141f0a40a470c0c81c2edcd8c45c6b0daf4f9 /fs/nfs/nfs4renewd.c | |
parent | 5043e900f5404c01864fbeb5826aa7de3981bbc1 (diff) | |
download | op-kernel-dev-58d9714a44a79bba9b414da3ffbf3c753dc5915f.zip op-kernel-dev-58d9714a44a79bba9b414da3ffbf3c753dc5915f.tar.gz |
NFSv4: Send RENEW requests to the server only when we're holding state
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4renewd.c')
-rw-r--r-- | fs/nfs/nfs4renewd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nfs/nfs4renewd.c b/fs/nfs/nfs4renewd.c index a300162..f62c2f7 100644 --- a/fs/nfs/nfs4renewd.c +++ b/fs/nfs/nfs4renewd.c @@ -54,6 +54,7 @@ #include <linux/nfs4.h> #include <linux/nfs_fs.h> #include "nfs4_fs.h" +#include "delegation.h" #define NFSDBG_FACILITY NFSDBG_PROC @@ -68,7 +69,7 @@ nfs4_renew_state(void *data) dprintk("%s: start\n", __FUNCTION__); /* Are there any active superblocks? */ if (list_empty(&clp->cl_superblocks)) - goto out; + goto out; spin_lock(&clp->cl_lock); lease = clp->cl_lease_time; last = clp->cl_last_renewal; @@ -76,6 +77,12 @@ nfs4_renew_state(void *data) timeout = (2 * lease) / 3 + (long)last - (long)now; /* Are we close to a lease timeout? */ if (time_after(now, last + lease/3)) { + if (list_empty(&clp->cl_state_owners)) { + set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); + spin_unlock(&clp->cl_lock); + nfs_expire_all_delegations(clp); + goto out; + } spin_unlock(&clp->cl_lock); /* Queue an asynchronous RENEW. */ nfs4_proc_async_renew(clp); |