b_vflags update requries bufobj lock
The trunc_dependencies() issue was reported by Alexander Lochmann <alexander.lochmann@tu-dortmund.de>, who found the problem by performing lock analysis using LockDoc, see https://doi.org/10.1145/3302424.3303948. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
cebcca89f1
commit
e3d6759585
@ -7546,7 +7546,9 @@ trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags)
|
||||
BO_LOCK(bo);
|
||||
goto cleanrestart;
|
||||
}
|
||||
BO_LOCK(bo);
|
||||
bp->b_vflags |= BV_SCANNED;
|
||||
BO_UNLOCK(bo);
|
||||
bremfree(bp);
|
||||
if (blkoff != 0) {
|
||||
allocbuf(bp, blkoff);
|
||||
|
@ -321,8 +321,9 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags)
|
||||
if (BUF_LOCK(bp,
|
||||
LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK,
|
||||
BO_LOCKPTR(bo)) != 0) {
|
||||
BO_LOCK(bo);
|
||||
bp->b_vflags &= ~BV_SCANNED;
|
||||
goto next;
|
||||
goto next_locked;
|
||||
}
|
||||
} else
|
||||
continue;
|
||||
@ -385,6 +386,7 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags)
|
||||
* to start from a known point.
|
||||
*/
|
||||
BO_LOCK(bo);
|
||||
next_locked:
|
||||
nbp = TAILQ_FIRST(&bo->bo_dirty.bv_hd);
|
||||
}
|
||||
if (waitfor != MNT_WAIT) {
|
||||
|
Loading…
Reference in New Issue
Block a user