diff options
author | dim <dim@FreeBSD.org> | 2015-07-04 21:50:39 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-07-04 21:50:39 +0000 |
commit | 6f44bd3256388beb23fd03fdf43ad5d53cf43e29 (patch) | |
tree | 37590f5c697f4198fdddec33c58aefdef0a5f485 /sys/kern/vfs_bio.c | |
parent | cea4c167517a0678c7dbf92a0324088dcbac1035 (diff) | |
parent | 76b8ff88e56f9ad0639b7e23dd9d1128a0750026 (diff) | |
download | FreeBSD-src-6f44bd3256388beb23fd03fdf43ad5d53cf43e29.zip FreeBSD-src-6f44bd3256388beb23fd03fdf43ad5d53cf43e29.tar.gz |
Merge ^/head r284737 through r285152.
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index c715725..b380578 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1597,6 +1597,12 @@ brelse(struct buf *bp) return; } + if ((bp->b_vflags & (BV_BKGRDINPROG | BV_BKGRDERR)) == BV_BKGRDERR) { + BO_LOCK(bp->b_bufobj); + bp->b_vflags &= ~BV_BKGRDERR; + BO_UNLOCK(bp->b_bufobj); + bdirty(bp); + } if (bp->b_iocmd == BIO_WRITE && (bp->b_ioflags & BIO_ERROR) && bp->b_error == EIO && !(bp->b_flags & B_INVAL)) { /* @@ -1853,7 +1859,11 @@ bqrelse(struct buf *bp) } /* buffers with stale but valid contents */ - if (bp->b_flags & B_DELWRI) { + if ((bp->b_flags & B_DELWRI) != 0 || (bp->b_vflags & (BV_BKGRDINPROG | + BV_BKGRDERR)) == BV_BKGRDERR) { + BO_LOCK(bp->b_bufobj); + bp->b_vflags &= ~BV_BKGRDERR; + BO_UNLOCK(bp->b_bufobj); qindex = QUEUE_DIRTY; } else { if ((bp->b_flags & B_DELWRI) == 0 && @@ -2372,6 +2382,16 @@ restart: continue; } + /* + * Requeue the background write buffer with error. + */ + if ((bp->b_vflags & BV_BKGRDERR) != 0) { + bremfreel(bp); + mtx_unlock(&bqclean); + bqrelse(bp); + continue; + } + KASSERT(bp->b_qindex == qindex, ("getnewbuf: inconsistent queue %d bp %p", qindex, bp)); |