- 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.
This commit is contained in:
Jeff Roberson 2003-10-04 16:09:40 +00:00
parent cac3558da3
commit 80cd3a0804
2 changed files with 12 additions and 8 deletions

View File

@ -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 &

View File

@ -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 &