summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-12-04 13:56:15 +0000
committerkib <kib@FreeBSD.org>2016-12-04 13:56:15 +0000
commitf1c5c5c049f0239048da64376609e69e8329e73e (patch)
tree6dda551dc9b1d541ef0747c3b696ae97ab2ae3c2 /sys/fs
parentf92d5f7bea4681df89562d184871c42fbeb33d93 (diff)
downloadFreeBSD-src-f1c5c5c049f0239048da64376609e69e8329e73e.zip
FreeBSD-src-f1c5c5c049f0239048da64376609e69e8329e73e.tar.gz
MFC r309209:
Do not enable nullfs vnode caching over nfs v4 mounts.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c2
-rw-r--r--sys/fs/nullfs/null_vfsops.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index b8aa2fd..075981b 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -1201,6 +1201,8 @@ out:
MNT_ILOCK(mp);
mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF |
MNTK_USES_BCACHE;
+ if ((VFSTONFS(mp)->nm_flag & NFSMNT_NFSV4) != 0)
+ mp->mnt_kern_flag |= MNTK_NULL_NOCACHE;
MNT_IUNLOCK(mp);
}
return (error);
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c
index 49bae28..de05e8b 100644
--- a/sys/fs/nullfs/null_vfsops.c
+++ b/sys/fs/nullfs/null_vfsops.c
@@ -188,7 +188,8 @@ nullfs_mount(struct mount *mp)
}
xmp->nullm_flags |= NULLM_CACHE;
- if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0)
+ if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0 ||
+ (xmp->nullm_vfs->mnt_kern_flag & MNTK_NULL_NOCACHE) != 0)
xmp->nullm_flags &= ~NULLM_CACHE;
MNT_ILOCK(mp);
OpenPOWER on IntegriCloud