Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 2024 00:27:09 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 625a622cc651 - stable/14 - vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done
Message-ID:  <202405230027.44N0R9Ib020596@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=625a622cc6511e250470ee3f84a8553c7c734de6

commit 625a622cc6511e250470ee3f84a8553c7c734de6
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-05-15 09:54:49 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-05-23 00:26:43 +0000

    vfs_domount_update(): postpone setting MNT_UNION until VFS_MOUNT() is done
    
    PR:     265311
    
    (cherry picked from commit 21ccdb4119afdfdfeaa80e9c8514171c65b35862)
---
 sys/kern/vfs_mount.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 9289c35e4f86..206618b4ac6b 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1314,7 +1314,7 @@ vfs_domount_update(
 	void *bufp;
 	struct mount *mp;
 	int error, export_error, i, len, fsid_up_len;
-	uint64_t flag;
+	uint64_t flag, mnt_union;
 	gid_t *grps;
 	fsid_t *fsid_up;
 	bool vfs_suser_failed;
@@ -1396,6 +1396,7 @@ vfs_domount_update(
 		vfs_deleteopt(*optlist, "fsid");
 	}
 
+	mnt_union = 0;
 	MNT_ILOCK(mp);
 	if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) {
 		MNT_IUNLOCK(mp);
@@ -1417,6 +1418,11 @@ vfs_domount_update(
 		mp->mnt_flag |= MNT_UPDATE;
 	} else {
 		mp->mnt_flag &= ~MNT_UPDATEMASK;
+		if ((mp->mnt_flag & MNT_UNION) == 0 &&
+		    (fsflags & MNT_UNION) != 0) {
+			fsflags &= ~MNT_UNION;
+			mnt_union = MNT_UNION;
+		}
 		mp->mnt_flag |= fsflags & (MNT_RELOAD | MNT_FORCE | MNT_UPDATE |
 		    MNT_SNAPSHOT | MNT_ROOTFS | MNT_UPDATEMASK | MNT_RDONLY);
 		if ((mp->mnt_flag & MNT_ASYNC) == 0)
@@ -1520,6 +1526,7 @@ vfs_domount_update(
 	if (error == 0) {
 		mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE |
 		    MNT_SNAPSHOT);
+		mp->mnt_flag |= mnt_union;
 	} else {
 		/*
 		 * If we fail, restore old mount flags. MNT_QUOTA is special,



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