diff options
author | imp <imp@FreeBSD.org> | 2007-12-30 05:53:45 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2007-12-30 05:53:45 +0000 |
commit | 95c2febd5a54df8cc4cb925da9b19dca1199bfdb (patch) | |
tree | 65a485387dc7c800f9c8bc5a23b418a8f6a3d3c0 | |
parent | 2b8395148ff378e52a5e00c0d2ac0123258b759b (diff) | |
download | FreeBSD-src-95c2febd5a54df8cc4cb925da9b19dca1199bfdb.zip FreeBSD-src-95c2febd5a54df8cc4cb925da9b19dca1199bfdb.tar.gz |
Rather than not redirting the bp when we get ENXIO, only redirty it
when the error is EIO. This catches a much larger class of errors
that are unlikely to succeed if retried.
Submitted by: bde
-rw-r--r-- | sys/kern/vfs_bio.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index b02d65b..f4a2a63 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1168,19 +1168,13 @@ brelse(struct buf *bp) return; } - if (bp->b_iocmd == BIO_WRITE && - (bp->b_ioflags & BIO_ERROR) && - bp->b_error != ENXIO && - !(bp->b_flags & B_INVAL)) { + if (bp->b_iocmd == BIO_WRITE && (bp->b_ioflags & BIO_ERROR) && + bp->b_error == EIO && !(bp->b_flags & B_INVAL)) { /* * Failed write, redirty. Must clear BIO_ERROR to prevent - * pages from being scrapped. If B_INVAL is set then - * this case is not run and the next case is run to - * destroy the buffer. B_INVAL can occur if the buffer - * is outside the range supported by the underlying device. - * If the error is that the device went away (ENXIO), we - * shouldn't redirty the buffer either, but discard the - * data too. + * pages from being scrapped. If the error is anything + * other than an I/O error (EIO), assume that retryingi + * is futile. */ bp->b_ioflags &= ~BIO_ERROR; bdirty(bp); |