Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2010 23:14: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: r210034 - head/sys/fs/nfsclient
Message-ID:  <201007132314.o6DNEdov084432@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue Jul 13 23:14:39 2010
New Revision: 210034
URL: http://svn.freebsd.org/changeset/base/210034

Log:
  For the experimental NFSv4 client, make sure that attributes that
  predate the issue of a delegation are not cached once the delegation
  is held. This is necessary, since cached attributes remain valid
  while the delegation is held.
  
  MFC after:	2 weeks

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

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clrpcops.c	Tue Jul 13 23:10:55 2010	(r210033)
+++ head/sys/fs/nfsclient/nfs_clrpcops.c	Tue Jul 13 23:14:39 2010	(r210034)
@@ -268,6 +268,14 @@ else printf(" fhl=0\n");
 #else
 				NFSLOCKNODE(np);
 				np->n_flag &= ~NDELEGMOD;
+				/*
+				 * Invalidate the attribute cache, so that
+				 * attributes that pre-date the issue of a
+				 * delegation are not cached, since the
+				 * cached attributes will remain valid while
+				 * the delegation is held.
+				 */
+				NFSINVALATTRCACHE(np);
 				NFSUNLOCKNODE(np);
 #endif
 				(void) nfscl_deleg(nmp->nm_mountp,
@@ -1724,6 +1732,12 @@ nfsrpc_create(vnode_t dvp, char *name, i
 		error = nfsrpc_createv4(dvp, name, namelen, vap, cverf, fmode,
 		  owp, &dp, cred, p, dnap, nnap, nfhpp, attrflagp, dattrflagp,
 		  dstuff, &unlocked);
+		/*
+		 * There is no need to invalidate cached attributes here,
+		 * since new post-delegation issue attributes are always
+		 * returned by nfsrpc_createv4() and these will update the
+		 * attribute cache.
+		 */
 		if (dp != NULL)
 			(void) nfscl_deleg(nmp->nm_mountp, owp->nfsow_clp,
 			    (*nfhpp)->nfh_fh, (*nfhpp)->nfh_len, cred, p, &dp);



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