Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Nov 2021 04:36:42 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 77ddf3808b60 - stable/13 - geom_vfs: lock devvp in g_vfs_close()
Message-ID:  <202111190436.1AJ4ag31034337@gitrepo.freebsd.org>

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

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

commit 77ddf3808b60e1e1fb521e14462561055d00ba58
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-11-01 05:46:52 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-11-19 04:25:28 +0000

    geom_vfs: lock devvp in g_vfs_close()
    
    (cherry picked from commit 8db7d16526debbca6bc7a32a57fd0378e48e37de)
---
 sys/geom/geom_vfs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c
index f01765b8ee30..b69610c4615e 100644
--- a/sys/geom/geom_vfs.c
+++ b/sys/geom/geom_vfs.c
@@ -286,12 +286,16 @@ g_vfs_close(struct g_consumer *cp)
 {
 	struct g_geom *gp;
 	struct g_vfs_softc *sc;
+	struct vnode *vp;
 
 	g_topology_assert();
 
 	gp = cp->geom;
 	sc = gp->softc;
+	vp = cp->private;
+	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 	bufobj_invalbuf(sc->sc_bo, V_SAVE, 0, 0);
+	VOP_UNLOCK(vp);
 	sc->sc_bo->bo_private = cp->private;
 	gp->softc = NULL;
 	mtx_destroy(&sc->sc_mtx);



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