From 95c2febd5a54df8cc4cb925da9b19dca1199bfdb Mon Sep 17 00:00:00 2001 From: imp Date: Sun, 30 Dec 2007 05:53:45 +0000 Subject: [PATCH] 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 --- sys/kern/vfs_bio.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index b02d65b384f8..f4a2a635879e 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);