aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-09-18 08:12:27 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2021-09-18 19:13:51 +0000
commit0d9e99ce3b1071c76ff5a2d9d4158341c0371c2f (patch)
tree8e7cad4b955a75d2cc0c4af2e01778929b74bb8d /sys
parent50b07c1f7131fd535bbe1b53a3a2e4dfcdcc2e51 (diff)
downloadsrc-0d9e99ce3b1071c76ff5a2d9d4158341c0371c2f.tar.gz
src-0d9e99ce3b1071c76ff5a2d9d4158341c0371c2f.zip
vfs: add the missing vnode interlock in vfs_mountroot_shuffle
Around v_mountedhere assignment.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_mountroot.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c
index e2a687511e11..5cf222901420 100644
--- a/sys/kern/vfs_mountroot.c
+++ b/sys/kern/vfs_mountroot.c
@@ -367,10 +367,12 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs)
error = vinvalbuf(vp, V_SAVE, 0, 0);
if (!error) {
cache_purge(vp);
+ VI_LOCK(vp);
mporoot->mnt_vnodecovered = vp;
vp->v_mountedhere = mporoot;
strlcpy(mporoot->mnt_stat.f_mntonname,
fspath, MNAMELEN);
+ VI_UNLOCK(vp);
VOP_UNLOCK(vp);
} else
vput(vp);