diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -302,12 +302,16 @@ { 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);