Date: Tue, 10 Jul 2012 12:37:03 -0400 From: Andrew Boyer <aboyer@averesystems.com> To: Sean Bruno <seanbru@yahoo-inc.com> Cc: "freebsd-scsi@freebsd.org" <freebsd-scsi@freebsd.org> Subject: Re: [patch] MFI should set bio_resid on command failure Message-ID: <2936EBFD-CA1E-4EC4-9790-80D1A5DC5567@averesystems.com> In-Reply-To: <1341340916.3370.6.camel@powernoodle.corp.yahoo.com> References: <909AAC62-7BB4-43E7-B04B-27466B038A07@averesystems.com> <1341340916.3370.6.camel@powernoodle.corp.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Jul 3, 2012, at 2:41 PM, Sean Bruno wrote: > On Tue, 2012-07-03 at 06:47 -0700, Andrew Boyer wrote: >> 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(). >>=20 >> -Andrew >>=20 >> Index: sys/dev/mfi/mfi_disk.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- sys/dev/mfi/mfi_disk.c (revision 238071) >> +++ sys/dev/mfi/mfi_disk.c (working copy) >> @@ -298,6 +298,7 @@ >> hdr =3D bio->bio_driver1; >>=20 >> if (bio->bio_flags & BIO_ERROR) { >> + bio->bio_resid =3D bio->bio_bcount; >> if (bio->bio_error =3D=3D 0) >> bio->bio_error =3D EIO; >> disk_err(bio, "hard error", -1, 1); >>=20 >> -------------------------------------------------- >> Andrew Boyer aboyer@averesystems.com >>=20 >=20 > This looks right to me. It mirrors the behavior in = mfi_disk_strategy() > as well. >=20 > Sean >=20 Anyone interested in committing? (And MFC'ing to stable/8=85) -Andrew -------------------------------------------------- Andrew Boyer aboyer@averesystems.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2936EBFD-CA1E-4EC4-9790-80D1A5DC5567>