[pnfs] [PATCH 10/11] nfs41: schedule state recovery on BAD or DEAD session

andros at netapp.com andros at netapp.com
Fri Jul 11 10:39:17 EDT 2008


From: Andy Adamson <andros at netapp.com>

When a clientid is stale, the sequence operation will return NFS4ERR_BADSESSION
or NFS4ERR_DEADSESSION. This will put the session into reset mode, and
run the session_reclaimer thread which calls destroy_session and
create_session. Destroy_session will also return NFS4ERR_BADSESSION or
NFS4ERR_DEADSESSION which is ignored by the session reset. Create_session
will return NFS4ERR_STALE_CLIENTID and the session reclaimer sets the
nfs_client cl_state to NFS4CLNT_LEASE_EXPIRED.

Catch the NFS4CLNT_LEASE_EXPIRED cl_state in nfs4_find_slot, and attempt to
recover the expired client id.

Signed-off-by: Andy Adamson<andros at netapp.com>
---
 fs/nfs/nfs4proc.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f5aacaf..47dc387 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -370,6 +370,13 @@ static inline struct nfs4_slot *nfs4_find_slot(struct nfs4_slot_table *tbl,
 			dprintk("%s Slot Table Empty\n", __func__);
 			spin_unlock(&tbl->slot_tbl_lock);
 			ret = nfs41_recover_session_sync(session);
+			if (test_and_clear_bit(NFS4CLNT_LEASE_EXPIRED,
+						&session->clp->cl_state)) {
+
+				printk(KERN_WARNING "%s Clientid Reset\n",
+					__func__);
+				nfs4_schedule_state_recovery(session->clp);
+			}
 			if (ret)
 				return slot;
 			nfs41_wait_session_reset(session);
-- 
1.5.4.1



More information about the pNFS mailing list