Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Apr 2010 01:00:22 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r207256 - stable/8/sys/fs/nfsclient
Message-ID:  <201004270100.o3R10MPe052418@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue Apr 27 01:00:22 2010
New Revision: 207256
URL: http://svn.freebsd.org/changeset/base/207256

Log:
  MFC: r206880
  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.

Modified:
  stable/8/sys/fs/nfsclient/nfs_clstate.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clstate.c	Tue Apr 27 00:58:19 2010	(r207255)
+++ stable/8/sys/fs/nfsclient/nfs_clstate.c	Tue Apr 27 01:00:22 2010	(r207256)
@@ -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?201004270100.o3R10MPe052418>