Index: sys/kern/vfs_bio.c =================================================================== --- sys/kern/vfs_bio.c +++ sys/kern/vfs_bio.c @@ -2605,8 +2605,10 @@ return; CTR3(KTR_BUF, "brelse(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); - KASSERT(!(bp->b_flags & (B_CLUSTER|B_PAGING)), + KASSERT((bp->b_flags & (B_CLUSTER | B_PAGING)) == 0, ("brelse: inappropriate B_PAGING or B_CLUSTER bp %p", bp)); + KASSERT((bp->b_flags & B_BARRIER) == 0, + ("brelse: barrier still set bp %p", bp)); KASSERT((bp->b_flags & B_VMIO) != 0 || (bp->b_flags & B_NOREUSE) == 0, ("brelse: non-VMIO buffer marked NOREUSE")); @@ -2799,8 +2801,10 @@ int qindex; CTR3(KTR_BUF, "bqrelse(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); - KASSERT(!(bp->b_flags & (B_CLUSTER|B_PAGING)), + KASSERT((bp->b_flags & (B_CLUSTER | B_PAGING)) == 0, ("bqrelse: inappropriate B_PAGING or B_CLUSTER bp %p", bp)); + KASSERT((bp->b_flags & B_BARRIER) == 0, + ("bqrelse: barrier still set bp %p", bp)); qindex = QUEUE_NONE; if (BUF_LOCKRECURSED(bp)) { @@ -4423,7 +4427,10 @@ CTR3(KTR_BUF, "bufdone(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); dropobj = NULL; - KASSERT(!(bp->b_flags & B_DONE), ("biodone: bp %p already done", bp)); + KASSERT((bp->b_flags & B_DONE) == 0, + ("biodone: bp %p already done", bp)); + KASSERT((bp->b_flags & B_BARRIER) == 0, + ("biodone: bp %p leaks B_BARRIER", bp)); runningbufwakeup(bp); if (bp->b_iocmd == BIO_WRITE) Index: sys/ufs/ffs/ffs_vfsops.c =================================================================== --- sys/ufs/ffs/ffs_vfsops.c +++ sys/ufs/ffs/ffs_vfsops.c @@ -2582,6 +2582,7 @@ error != EOPNOTSUPP) { bp->b_error = error; bp->b_ioflags |= BIO_ERROR; + bp->b_flags &= ~B_BARRIER; bufdone(bp); return; } @@ -2594,6 +2595,7 @@ if (error != 0 && error != EOPNOTSUPP) { bp->b_error = error; bp->b_ioflags |= BIO_ERROR; + bp->b_flags &= ~B_BARRIER; bufdone(bp); return; }