summaryrefslogtreecommitdiffstats
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
parentf92d5f7bea4681df89562d184871c42fbeb33d93 (diff)
downloadFreeBSD-src-f1c5c5c049f0239048da64376609e69e8329e73e.zip
FreeBSD-src-f1c5c5c049f0239048da64376609e69e8329e73e.tar.gz
MFC r309209:
Do not enable nullfs vnode caching over nfs v4 mounts.
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c2
-rw-r--r--sys/fs/nullfs/null_vfsops.c3
-rw-r--r--sys/sys/mount.h3
3 files changed, 6 insertions, 2 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);
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index b57d47d..d20d359 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -362,7 +362,8 @@ void __mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *);
#define MNTK_SUSPEND 0x08000000 /* request write suspension */
#define MNTK_SUSPEND2 0x04000000 /* block secondary writes */
#define MNTK_SUSPENDED 0x10000000 /* write operations are suspended */
-#define MNTK_UNUSED25 0x20000000 /* --available-- */
+#define MNTK_NULL_NOCACHE 0x20000000 /* auto disable cache for nullfs
+ mounts over this fs */
#define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */
#define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */
OpenPOWER on IntegriCloud