summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfsclient
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2010-07-13 23:14:39 +0000
committerrmacklem <rmacklem@FreeBSD.org>2010-07-13 23:14:39 +0000
commit32ae1ad8de2b50b8f776eed075557edb4a4ea0c1 (patch)
treee06a9ea0caf0f433e9e37097e560641b65184df3 /sys/fs/nfsclient
parent0f4e77e7f70ac8dc32bdd0b660e1f86fba462a17 (diff)
downloadFreeBSD-src-32ae1ad8de2b50b8f776eed075557edb4a4ea0c1.zip
FreeBSD-src-32ae1ad8de2b50b8f776eed075557edb4a4ea0c1.tar.gz
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
Diffstat (limited to 'sys/fs/nfsclient')
-rw-r--r--sys/fs/nfsclient/nfs_clrpcops.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index f647810..89fd0a2 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -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, int namelen, struct vattr *vap,
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);
OpenPOWER on IntegriCloud