Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 2010 05:18:21 +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: r208254 - head/sys/fs/nfsclient
Message-ID:  <201005180518.o4I5ILXU049959@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue May 18 05:18:21 2010
New Revision: 208254
URL: http://svn.freebsd.org/changeset/base/208254

Log:
  Allow the experimental NFSv4 client to use cached attributes
  when a write delegation is held. Also, add a missing
  mtx_unlock() call for the ACL debugging code.
  
  MFC after:	5 days

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

Modified: head/sys/fs/nfsclient/nfs_clsubs.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clsubs.c	Tue May 18 05:12:54 2010	(r208253)
+++ head/sys/fs/nfsclient/nfs_clsubs.c	Tue May 18 05:18:21 2010	(r208254)
@@ -188,11 +188,12 @@ ncl_getattrcache(struct vnode *vp, struc
 	struct nfsnode *np;
 	struct vattr *vap;
 	struct nfsmount *nmp;
-	int timeo;
+	int timeo, mustflush;
 	
 	np = VTONFS(vp);
 	vap = &np->n_vattr.na_vattr;
 	nmp = VFSTONFS(vp->v_mount);
+	mustflush = nfscl_mustflush(vp);	/* must be before mtx_lock() */
 #ifdef NFS_ACDEBUG
 	mtx_lock(&Giant);	/* ncl_printf() */
 #endif
@@ -228,9 +229,13 @@ ncl_getattrcache(struct vnode *vp, struc
 			   (time_second - np->n_attrstamp), timeo);
 #endif
 
-	if ((time_second - np->n_attrstamp) >= timeo) {
+	if ((time_second - np->n_attrstamp) >= timeo &&
+	    mustflush != 0) {
 		newnfsstats.attrcache_misses++;
 		mtx_unlock(&np->n_mtx);
+#ifdef NFS_ACDEBUG
+		mtx_unlock(&Giant);	/* ncl_printf() */
+#endif
 		return( ENOENT);
 	}
 	newnfsstats.attrcache_hits++;



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