From dfcbfdbb909b07ee3b9211509987285cdc29a70c Mon Sep 17 00:00:00 2001 From: Sean Bruno Date: Wed, 11 Jul 2012 18:16:54 +0000 Subject: [PATCH] When an MFI command fails, the driver needs to set bio->bio_resid so that the upper levels notice. Otherwise we see commands silently failing leading to data corruption. This mirrors dadone() Submitted by: Andrew Boyer aboyer@averesystems.com Reviewed by: scottl@freebsd.org MFC after: 2 weeks --- sys/dev/mfi/mfi_disk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/mfi/mfi_disk.c b/sys/dev/mfi/mfi_disk.c index fc43e6721c5a..18ceb99cbc9d 100644 --- a/sys/dev/mfi/mfi_disk.c +++ b/sys/dev/mfi/mfi_disk.c @@ -298,6 +298,7 @@ mfi_disk_complete(struct bio *bio) hdr = bio->bio_driver1; if (bio->bio_flags & BIO_ERROR) { + bio->bio_resid = bio->bio_bcount; if (bio->bio_error == 0) bio->bio_error = EIO; disk_err(bio, "hard error", -1, 1);