mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
geom_vfs: lock devvp in g_vfs_close()
It is needed for g_vfs_close() invalidating the buffers. We rely on the vnode lock for correctness. Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32761
This commit is contained in:
parent
df07bfda67
commit
8db7d16526
1 changed files with 4 additions and 0 deletions
|
|
@ -302,12 +302,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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue