aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-12-23 15:21:41 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-12-23 15:21:41 -0500
commitb79a4a1b45b2543e38026303a1956bdc0aababa0 (patch)
tree73c7dba187dbe05f5527f47ccb42523f4655f77b /fs/nfs/nfs4proc.c
parent6dc9d57af9917f5c7faa13c17b770dce17c3972b (diff)
NFSv4: Fix state recovery when the client runs over the grace period
If the client for some reason is not able to recover all its state within the time allotted for the grace period, and the server reboots again, the client is not allowed to recover the state that was 'lost' using reboot recovery. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d53aa2dace84..279ab36b5a67 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -984,7 +984,7 @@ static int nfs4_recover_expired_lease(struct nfs_server *server)
984 ret = nfs4_wait_clnt_recover(server->client, clp); 984 ret = nfs4_wait_clnt_recover(server->client, clp);
985 if (ret != 0) 985 if (ret != 0)
986 return ret; 986 return ret;
987 if (!test_and_clear_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) 987 if (!test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state))
988 break; 988 break;
989 nfs4_schedule_state_recovery(clp); 989 nfs4_schedule_state_recovery(clp);
990 } 990 }
@@ -2942,7 +2942,6 @@ static int _nfs4_proc_setclientid_confirm(struct nfs_client *clp, struct rpc_cre
2942 spin_lock(&clp->cl_lock); 2942 spin_lock(&clp->cl_lock);
2943 clp->cl_lease_time = fsinfo.lease_time * HZ; 2943 clp->cl_lease_time = fsinfo.lease_time * HZ;
2944 clp->cl_last_renewal = now; 2944 clp->cl_last_renewal = now;
2945 clear_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
2946 spin_unlock(&clp->cl_lock); 2945 spin_unlock(&clp->cl_lock);
2947 } 2946 }
2948 return status; 2947 return status;
@@ -3690,11 +3689,13 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
3690} 3689}
3691 3690
3692struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = { 3691struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = {
3692 .state_flag_bit = NFS_STATE_RECLAIM_REBOOT,
3693 .recover_open = nfs4_open_reclaim, 3693 .recover_open = nfs4_open_reclaim,
3694 .recover_lock = nfs4_lock_reclaim, 3694 .recover_lock = nfs4_lock_reclaim,
3695}; 3695};
3696 3696
3697struct nfs4_state_recovery_ops nfs4_network_partition_recovery_ops = { 3697struct nfs4_state_recovery_ops nfs4_nograce_recovery_ops = {
3698 .state_flag_bit = NFS_STATE_RECLAIM_NOGRACE,
3698 .recover_open = nfs4_open_expired, 3699 .recover_open = nfs4_open_expired,
3699 .recover_lock = nfs4_lock_expired, 3700 .recover_lock = nfs4_lock_expired,
3700}; 3701};