git: f10a8d09716d - main - Allow the MNT_FORCE flag to be passed through to an initial mount.

From: Kirk McKusick <mckusick_at_FreeBSD.org>
Date: Mon, 15 Nov 2021 23:52:50 UTC
The branch main has been updated by mckusick:

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

commit f10a8d09716dd1024023d244936597fca8360945
Author:     Kirk McKusick <mckusick@FreeBSD.org>
AuthorDate: 2021-11-15 23:45:06 +0000
Commit:     Kirk McKusick <mckusick@FreeBSD.org>
CommitDate: 2021-11-15 23:45:56 +0000

    Allow the MNT_FORCE flag to be passed through to an initial mount.
    
    When doing an initial mount(8) with its -f (force) flag, the MNT_FORCE
    flag is not passed through to the underlying filesystem mount routine.
    MNT_FORCE is only passed through on later updates to an existing
    mount. With this commit the MNT_FORCE flag is now passed through on the
    initial mount.
    
    Sanity check: kib
    Sponsored by: Netflix
---
 sys/kern/vfs_mount.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 2fc98d3cc6c8..5b68a8fec474 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1138,7 +1138,8 @@ vfs_domount_first(
 	/* XXXMAC: pass to vfs_mount_alloc? */
 	mp->mnt_optnew = *optlist;
 	/* Set the mount level flags. */
-	mp->mnt_flag = (fsflags & (MNT_UPDATEMASK | MNT_ROOTFS | MNT_RDONLY));
+	mp->mnt_flag = (fsflags &
+	    (MNT_UPDATEMASK | MNT_ROOTFS | MNT_RDONLY | MNT_FORCE));
 
 	/*
 	 * Mount the filesystem.