Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Oct 2021 09:15:47 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: fa7ebd573910 - stable/13 - vfs: add the missing vnode interlock in vfs_mountroot_shuffle
Message-ID:  <202110110915.19B9FlNk009453@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mjg:

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

commit fa7ebd573910f180e31fedfbd36a984139de72a7
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-09-18 08:12:27 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2021-10-11 09:10:13 +0000

    vfs: add the missing vnode interlock in vfs_mountroot_shuffle
    
    Around v_mountedhere assignment.
    
    (cherry picked from commit 0d9e99ce3b1071c76ff5a2d9d4158341c0371c2f)
---
 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 4f80104c311c..7adf63db2dac 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110110915.19B9FlNk009453>