From 420cf70112c4eff7ddf30b717796a3e4852fc1c4 Mon Sep 17 00:00:00 2001 From: jeff Date: Sat, 4 Oct 2003 16:09:40 +0000 Subject: - Don't use vrecycle() call vgonel() directly after grabing the vnode interlock. We do this so that we still hold the interlock when we lock the vnode later. This prevents races with the mnt vnode list. --- sys/gnu/ext2fs/ext2_vfsops.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/gnu/ext2fs') diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index a51d393..b8b15be 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -576,16 +576,18 @@ loop: goto loop; } nvp = TAILQ_NEXT(vp, v_nmntvnodes); + VI_LOCK(vp); mtx_unlock(&mntvnode_mtx); /* * Step 4: invalidate all inactive vnodes. */ - if (vrecycle(vp, NULL, td)) - goto loop; + if (vp->v_usecount == 0) { + vgonel(vp, td); + goto loop; + } /* * Step 5: invalidate all cached file data. */ - mtx_lock(&vp->v_interlock); if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) { goto loop; } @@ -903,8 +905,8 @@ loop: if (vp->v_mount != mp) goto loop; nvp = TAILQ_NEXT(vp, v_nmntvnodes); - mtx_unlock(&mntvnode_mtx); VI_LOCK(vp); + mtx_unlock(&mntvnode_mtx); ip = VTOI(vp); if (vp->v_type == VNON || ((ip->i_flag & -- cgit v1.1