From a05c4807ad1f54fe0b6139bf438ee4d4c45cf3d1 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 23 Dec 2008 15:21:42 -0500 Subject: [PATCH] --- yaml --- r: 124723 b: refs/heads/master c: 0f605b56008c4b6b075217480c36ba395ca4eaa4 h: refs/heads/master i: 124721: d28d669949d1dc4e0af2f3f35e51c4880c40e537 124719: 02b6bd107d35978617f0edf8ea25cca75dfcb286 v: v3 --- [refs] | 2 +- trunk/fs/nfs/nfs4state.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index fdf8f3f49559..a76b4384a3cc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e598d843c08a7ab6bdfa8098de49afb017fc6c6a +refs/heads/master: 0f605b56008c4b6b075217480c36ba395ca4eaa4 diff --git a/trunk/fs/nfs/nfs4state.c b/trunk/fs/nfs/nfs4state.c index 3cc88a5d9881..a780518c5c3f 100644 --- a/trunk/fs/nfs/nfs4state.c +++ b/trunk/fs/nfs/nfs4state.c @@ -1059,19 +1059,19 @@ static int nfs4_check_lease(struct nfs_client *clp) struct rpc_cred *cred; int status = -NFS4ERR_EXPIRED; - /* Are there any open files on this volume? */ + /* Is the client already known to have an expired lease? */ + if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) + return 0; cred = nfs4_get_renew_cred(clp); - if (cred != NULL) { - /* Yes there are: try to renew the old lease */ - status = nfs4_proc_renew(clp, cred); - put_rpccred(cred); - nfs4_recovery_handle_error(clp, status); - return status; + if (cred == NULL) { + cred = nfs4_get_setclientid_cred(clp); + if (cred == NULL) + goto out; } - - /* "reboot" to ensure we clear all state on the server */ - clp->cl_boot_time = CURRENT_TIME; - set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); + status = nfs4_proc_renew(clp, cred); + put_rpccred(cred); +out: + nfs4_recovery_handle_error(clp, status); return status; }