- Check XLOCK prior to accessing v_data.

This commit is contained in:
Jeff Roberson 2003-10-05 06:43:30 +00:00
parent 6acdfd69be
commit 055cfed702
2 changed files with 12 additions and 0 deletions

View File

@ -318,6 +318,11 @@ coda_checkunmounting(mp)
nvp = TAILQ_NEXT(vp, v_nmntvnodes); nvp = TAILQ_NEXT(vp, v_nmntvnodes);
if (vp->v_mount != mp) if (vp->v_mount != mp)
continue; continue;
VI_LOCK(vp);
if (vp->v_iflag & VI_XLOCK) {
VI_UNLOCK(vp);
continue;
}
cp = VTOC(vp); cp = VTOC(vp);
count++; count++;
if (!(cp->c_flags & C_UNMOUNTING)) { if (!(cp->c_flags & C_UNMOUNTING)) {
@ -325,6 +330,7 @@ coda_checkunmounting(mp)
printf("vp %p, cp %p missed\n", vp, cp); printf("vp %p, cp %p missed\n", vp, cp);
cp->c_flags |= C_UNMOUNTING; cp->c_flags |= C_UNMOUNTING;
} }
VI_UNLOCK(vp);
} }
mtx_unlock(&mntvnode_mtx); mtx_unlock(&mntvnode_mtx);
} }

View File

@ -318,6 +318,11 @@ coda_checkunmounting(mp)
nvp = TAILQ_NEXT(vp, v_nmntvnodes); nvp = TAILQ_NEXT(vp, v_nmntvnodes);
if (vp->v_mount != mp) if (vp->v_mount != mp)
continue; continue;
VI_LOCK(vp);
if (vp->v_iflag & VI_XLOCK) {
VI_UNLOCK(vp);
continue;
}
cp = VTOC(vp); cp = VTOC(vp);
count++; count++;
if (!(cp->c_flags & C_UNMOUNTING)) { if (!(cp->c_flags & C_UNMOUNTING)) {
@ -325,6 +330,7 @@ coda_checkunmounting(mp)
printf("vp %p, cp %p missed\n", vp, cp); printf("vp %p, cp %p missed\n", vp, cp);
cp->c_flags |= C_UNMOUNTING; cp->c_flags |= C_UNMOUNTING;
} }
VI_UNLOCK(vp);
} }
mtx_unlock(&mntvnode_mtx); mtx_unlock(&mntvnode_mtx);
} }