Skip to content

Commit

Permalink
NFSv4: Don't tell server we rebooted when not necessary
Browse files Browse the repository at this point in the history
Instead of doing a full setclientid, try doing a RENEW call first.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 23, 2008
1 parent e598d84 commit 0f605b5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions fs/nfs/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0f605b5

Please sign in to comment.