vfs: add the missing vnode interlock in vfs_mountroot_shuffle

Around v_mountedhere assignment.
This commit is contained in:
Mateusz Guzik 2021-09-18 10:12:27 +02:00
parent 50b07c1f71
commit 0d9e99ce3b

View File

@ -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);