Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 2010 01:02:39 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r206880 - head/sys/fs/nfsclient
Message-ID:  <201004200102.o3K12dsp068619@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue Apr 20 01:02:39 2010
New Revision: 206880
URL: http://svn.freebsd.org/changeset/base/206880

Log:
  For the experimental NFS client doing an NFSv4 mount,
  set the NFSCLFLAGS_RECVRINPROG while doing recovery from an expired
  lease in a manner similar to r206818 for server reboot recovery.
  This will prevent the function that acquires stateids for I/O
  operations from acquiring out of date stateids during recovery.
  Also, fix up mutex locking on the nfsc_flags field.
  
  MFC after:	1 week

Modified:
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Mon Apr 19 23:40:46 2010	(r206879)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Tue Apr 20 01:02:39 2010	(r206880)
@@ -2111,6 +2111,7 @@ nfscl_hasexpired(struct nfsclclient *clp
 		NFSUNLOCKCLSTATE();
 		return (0);
 	}
+	clp->nfsc_flags |= NFSCLFLAGS_RECVRINPROG;
 	NFSUNLOCKCLSTATE();
 
 	nmp = clp->nfsc_nmp;
@@ -2127,6 +2128,7 @@ nfscl_hasexpired(struct nfsclclient *clp
 		 * Clear out any state.
 		 */
 		nfscl_cleanclient(clp);
+		NFSLOCKCLSTATE();
 		clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID |
 		    NFSCLFLAGS_RECOVER);
 	} else {
@@ -2140,14 +2142,15 @@ nfscl_hasexpired(struct nfsclclient *clp
 		 * Expire the state for the client.
 		 */
 		nfscl_expireclient(clp, nmp, cred, p);
+		NFSLOCKCLSTATE();
 		clp->nfsc_flags |= NFSCLFLAGS_HASCLIENTID;
 		clp->nfsc_flags &= ~NFSCLFLAGS_RECOVER;
 	}
-	NFSFREECRED(cred);
-	clp->nfsc_flags &= ~NFSCLFLAGS_EXPIREIT;
-	NFSLOCKCLSTATE();
+	clp->nfsc_flags &= ~(NFSCLFLAGS_EXPIREIT | NFSCLFLAGS_RECVRINPROG);
+	wakeup(&clp->nfsc_flags);
 	nfsv4_unlock(&clp->nfsc_lock, 0);
 	NFSUNLOCKCLSTATE();
+	NFSFREECRED(cred);
 	return (error);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004200102.o3K12dsp068619>