- Lock the buf before inspecting its contents.
This commit is contained in:
parent
542bd65fcb
commit
619bddc702
@ -2658,18 +2658,16 @@ again:
|
|||||||
for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
|
for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
|
||||||
if (bvecpos >= bvecsize)
|
if (bvecpos >= bvecsize)
|
||||||
break;
|
break;
|
||||||
|
if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) {
|
||||||
|
nbp = TAILQ_NEXT(bp, b_vnbufs);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ((bp->b_flags & (B_DELWRI | B_NEEDCOMMIT)) !=
|
if ((bp->b_flags & (B_DELWRI | B_NEEDCOMMIT)) !=
|
||||||
(B_DELWRI | B_NEEDCOMMIT)) {
|
(B_DELWRI | B_NEEDCOMMIT)) {
|
||||||
nbp = TAILQ_NEXT(bp, b_vnbufs);
|
nbp = TAILQ_NEXT(bp, b_vnbufs);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (BUF_LOCK(bp,
|
VI_UNLOCK(vp);
|
||||||
LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK,
|
|
||||||
VI_MTX(vp))) {
|
|
||||||
VI_LOCK(vp);
|
|
||||||
nbp = TAILQ_NEXT(bp, b_vnbufs);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
bremfree(bp);
|
bremfree(bp);
|
||||||
/*
|
/*
|
||||||
* Work out if all buffers are using the same cred
|
* Work out if all buffers are using the same cred
|
||||||
|
Loading…
x
Reference in New Issue
Block a user