[RFC 51/85] nfs41: state reclaimer renew lease error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andy Adamson <andros@xxxxxxxxxx>

The state reclaimer has been called due to a NFS4_STALE_CLIENTID or NFS4_EXPIRE
error. First it tries to renew the old lease (network partion case) which for
v4.1 means an nfs4_proc_sequence call. Any error from the sequence operation
means that the lease cannot be renewed.

Switch on the minorversion to handle the error return from the renew lease call.

Signed-off-by: Andy Adamson<andros@xxxxxxxxxx>
Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
---
 fs/nfs/nfs4state.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index d3c5e92..0d6b902 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -975,18 +975,24 @@ restart_loop:
 		/* Yes there are: try to renew the old lease */
 		status = ops->renew_lease(clp, cred);
 		put_rpccred(cred);
-		switch (status) {
-		case 0:
-		case -NFS4ERR_CB_PATH_DOWN:
+		if (!status)
 			goto out;
-		case -NFS4ERR_STALE_CLIENTID:
-		case -NFS4ERR_LEASE_MOVED:
-			ops = nfs4_reboot_recovery_ops[clp->cl_minorversion];
-		}
+		if (clp->cl_minorversion == 0)
+			switch (status) {
+			case -NFS4ERR_CB_PATH_DOWN:
+				goto out;
+			case -NFS4ERR_STALE_CLIENTID:
+			case -NFS4ERR_LEASE_MOVED:
+				break;
+			default:
+				goto establish_clid;
+			}
+		ops = nfs4_reboot_recovery_ops[clp->cl_minorversion];
 	} else {
 		/* "reboot" to ensure we clear all state on the server */
 		clp->cl_boot_time = CURRENT_TIME;
 	}
+establish_clid:
 	/* We're going to have to re-establish a clientid */
 	nfs4_state_mark_reclaim(clp);
 	status = -ENOENT;
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux