From 0d9e99ce3b1071c76ff5a2d9d4158341c0371c2f Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Sat, 18 Sep 2021 10:12:27 +0200 Subject: [PATCH] vfs: add the missing vnode interlock in vfs_mountroot_shuffle Around v_mountedhere assignment. --- sys/kern/vfs_mountroot.c | 2 ++ 1 file changed, 2 insertions(+) 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);