Skip to contentSkip to conversation

NFS: prevent hang if EXCHANGEID returns NFS4ERR_DELAY

PATCH New Fred Isaman 1 participant 1 message Jun 7, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFS: prevent hang if EXCHANGEID returns NFS4ERR_DELAY

If EXCHANGEID returns NFS4ERR_DELAY, the mount will hang as the statemanager goes into an infinite loop. Hiting ctrl-c and trying to remount will then hit the BUG_ON(clp->cl_cons_state != NFS_CS_READY) in nfs_found_client().

---
 fs/nfs/nfs4state.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
fs/nfs/nfs4state.c +5 -2
index de13309..0cdfccd 100644
@@ -1639,7 +1639,7 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
 	set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
 	dprintk("%s: handled error %d for server %s\n", __func__, status,
 			clp->cl_hostname);
-	return 0;
+	return -EAGAIN;
 }
 
 static int nfs4_establish_lease(struct nfs_client *clp)
@@ -1665,8 +1665,11 @@ static int nfs4_reclaim_lease(struct nfs_client *clp)
 	int status;
 
 	status = nfs4_establish_lease(clp);
-	if (status < 0)
+	if (status < 0) {
+		if (status == -EAGAIN)
+			status = 0;
 		return status;
+	}
 	if (test_and_clear_bit(NFS4CLNT_SERVER_SCOPE_MISMATCH, &clp->cl_state))
 		nfs4_state_start_reclaim_nograce(clp);
 	if (!test_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state))
Signature · 1 line
1.7.2.1