svn commit: r364077 - in head/sys: fs/tmpfs kern ufs/ffs
Mateusz Guzik
mjg at FreeBSD.org
Mon Aug 10 11:51:22 UTC 2020
Author: mjg
Date: Mon Aug 10 11:51:21 2020
New Revision: 364077
URL: https://svnweb.freebsd.org/changeset/base/364077
Log:
vfs: clean MNTK_FPLOOKUP if MNT_UNION is set
Elides checking it during lookup.
Modified:
head/sys/fs/tmpfs/tmpfs_vfsops.c
head/sys/kern/vfs_cache.c
head/sys/ufs/ffs/ffs_vfsops.c
Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Aug 10 11:46:39 2020 (r364076)
+++ head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Aug 10 11:51:21 2020 (r364077)
@@ -372,6 +372,13 @@ tmpfs_mount(struct mount *mp)
}
tmp->tm_nomtime = vfs_getopt(mp->mnt_optnew, "nomtime", NULL,
0) == 0;
+ MNT_ILOCK(mp);
+ if ((mp->mnt_flag & MNT_UNION) == 0) {
+ mp->mnt_kern_flag |= MNTK_FPLOOKUP;
+ } else {
+ mp->mnt_kern_flag &= ~MNTK_FPLOOKUP;
+ }
+ MNT_IUNLOCK(mp);
return (0);
}
@@ -462,7 +469,7 @@ tmpfs_mount(struct mount *mp)
mp->mnt_flag |= MNT_LOCAL;
mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED |
MNTK_TEXT_REFS | MNTK_NOMSYNC;
- if (!nonc)
+ if (!nonc && (mp->mnt_flag & MNT_UNION) == 0)
mp->mnt_kern_flag |= MNTK_FPLOOKUP;
MNT_IUNLOCK(mp);
Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c Mon Aug 10 11:46:39 2020 (r364076)
+++ head/sys/kern/vfs_cache.c Mon Aug 10 11:51:21 2020 (r364077)
@@ -3701,8 +3701,6 @@ cache_fplookup_mp_supported(struct mount *mp)
return (false);
if ((mp->mnt_kern_flag & MNTK_FPLOOKUP) == 0)
return (false);
- if ((mp->mnt_flag & MNT_UNION) != 0)
- return (false);
return (true);
}
Modified: head/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vfsops.c Mon Aug 10 11:46:39 2020 (r364076)
+++ head/sys/ufs/ffs/ffs_vfsops.c Mon Aug 10 11:51:21 2020 (r364077)
@@ -805,7 +805,7 @@ ffs_mount(struct mount *mp)
*/
if ((mp->mnt_kern_flag & MNTK_FPLOOKUP) != 0)
panic("MNTK_FPLOOKUP set on mount %p when it should not be", mp);
- if ((mp->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0)
+ if ((mp->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS | MNT_UNION)) == 0)
mp->mnt_kern_flag |= MNTK_FPLOOKUP;
MNT_IUNLOCK(mp);
More information about the svn-src-all
mailing list