aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2023-11-09 20:18:47 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2023-11-09 20:18:47 +0000
commitede4c412b3ea9289ef42c664b01b6b5ff7eac434 (patch)
treea49cc9c1d566f7c4624508f293dbe7c3a6e3e7d6
parentaf21145f33d75c8d754b2371d03c181cd0c730e7 (diff)
downloadsrc-ede4c412b3ea9289ef42c664b01b6b5ff7eac434.tar.gz
src-ede4c412b3ea9289ef42c664b01b6b5ff7eac434.zip
vfs_domount_update(): ensure that 'goto end' works
We need to vfs_op_enter()/vn_seqc_write_start() before jumping to cleanup. PR: 274992 Reported by: trasz Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixes: 9ef7a491a4236810e50f0a2ee8d52f5c4bb02c64
-rw-r--r--sys/kern/vfs_mount.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index aa4642c0ba8c..1a559bfd998e 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1380,6 +1380,8 @@ vfs_domount_update(
VOP_UNLOCK(vp);
rootvp = NULL;
+ vfs_op_enter(mp);
+ vn_seqc_write_begin(vp);
if (vfs_getopt(*optlist, "fsid", (void **)&fsid_up,
&fsid_up_len) == 0) {
@@ -1394,9 +1396,6 @@ vfs_domount_update(
vfs_deleteopt(*optlist, "fsid");
}
- vfs_op_enter(mp);
- vn_seqc_write_begin(vp);
-
MNT_ILOCK(mp);
if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) {
MNT_IUNLOCK(mp);