diff options
| author | Jeff Roberson <jeff@FreeBSD.org> | 2003-10-04 16:09:40 +0000 |
|---|---|---|
| committer | Jeff Roberson <jeff@FreeBSD.org> | 2003-10-04 16:09:40 +0000 |
| commit | 80cd3a08049a2ac79900713686bc7c8e31b8e881 (patch) | |
| tree | 742ef7d30a2fe9056002b12a0336a8c66e7214e4 | |
| parent | cac3558da3e62fb14539ecf073d570aa4c16a75a (diff) | |
- 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.
Notes
svn path=/head/; revision=120751
| -rw-r--r-- | sys/gnu/ext2fs/ext2_vfsops.c | 10 | ||||
| -rw-r--r-- | sys/gnu/fs/ext2fs/ext2_vfsops.c | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index a51d393fcc37..b8b15be131f0 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 & diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index a51d393fcc37..b8b15be131f0 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/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 & |
