git: 8d194cc56d93 - stable/13 - ffs: fix newly introduced LOR between mntfs vnode lock and topology lock
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 19 Nov 2021 04:36:47 UTC
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8d194cc56d935734ff47ad187ffe99601658d0ac commit 8d194cc56d935734ff47ad187ffe99601658d0ac Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-11-16 17:31:11 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-11-19 04:25:28 +0000 ffs: fix newly introduced LOR between mntfs vnode lock and topology lock (cherry picked from commit c34a5148e8f21e9be28330c4ae4884b6f31193dd) --- sys/geom/geom_vfs.c | 2 -- sys/ufs/ffs/ffs_vfsops.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index b69610c4615e..ab9d4a001c76 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -293,9 +293,7 @@ g_vfs_close(struct g_consumer *cp) 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); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 8d0d00bb0231..507f0b148fc5 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1462,6 +1462,7 @@ ffs_unmount(mp, mntflags) taskqueue_free(ump->um_trim_tq); free (ump->um_trimhash, M_TRIM); } + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); g_topology_lock(); g_vfs_close(ump->um_cp); g_topology_unlock(); @@ -1469,7 +1470,6 @@ ffs_unmount(mp, mntflags) ump->um_odevvp->v_bufobj.bo_flag &= ~BO_NOBUFS; BO_UNLOCK(&ump->um_odevvp->v_bufobj); atomic_store_rel_ptr((uintptr_t *)&ump->um_dev->si_mountpt, 0); - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); mntfs_freevp(ump->um_devvp); vrele(ump->um_odevvp); dev_rel(ump->um_dev);