Date: Tue, 3 Jul 2012 09:47:46 -0400 From: Andrew Boyer <aboyer@averesystems.com> To: freebsd-scsi@freebsd.org Cc: Sean Bruno <seanbru@yahoo-inc.com> Subject: [patch] MFI should set bio_resid on command failure Message-ID: <909AAC62-7BB4-43E7-B04B-27466B038A07@averesystems.com>
next in thread | raw e-mail | index | archive | help
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().
-Andrew
Index: sys/dev/mfi/mfi_disk.c
===================================================================
--- sys/dev/mfi/mfi_disk.c (revision 238071)
+++ sys/dev/mfi/mfi_disk.c (working copy)
@@ -298,6 +298,7 @@
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);
--------------------------------------------------
Andrew Boyer aboyer@averesystems.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?909AAC62-7BB4-43E7-B04B-27466B038A07>
