From owner-freebsd-scsi@FreeBSD.ORG Tue Jul 3 13:47:49 2012 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BE211065673 for ; Tue, 3 Jul 2012 13:47:49 +0000 (UTC) (envelope-from aboyer@averesystems.com) Received: from mail.averesystems.com (50-73-27-109-cpennsylvania.hfc.comcastbusiness.net [50.73.27.109]) by mx1.freebsd.org (Postfix) with ESMTP id 192218FC0C for ; Tue, 3 Jul 2012 13:47:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.averesystems.com (Postfix) with ESMTP id C705248068D; Tue, 3 Jul 2012 09:47:51 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.averesystems.com Received: from mail.averesystems.com ([127.0.0.1]) by localhost (mail.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YmEz+AzK6hM8; Tue, 3 Jul 2012 09:47:51 -0400 (EDT) Received: from riven.arriad.com (206.193.225.214.nauticom.net [206.193.225.214]) by mail.averesystems.com (Postfix) with ESMTPSA id F3E3148067A; Tue, 3 Jul 2012 09:47:50 -0400 (EDT) From: Andrew Boyer Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Tue, 3 Jul 2012 09:47:46 -0400 Message-Id: <909AAC62-7BB4-43E7-B04B-27466B038A07@averesystems.com> To: freebsd-scsi@freebsd.org Mime-Version: 1.0 (Apple Message framework v1278) X-Mailer: Apple Mail (2.1278) Cc: Sean Bruno Subject: [patch] MFI should set bio_resid on command failure X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2012 13:47:49 -0000 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 =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); -------------------------------------------------- Andrew Boyer aboyer@averesystems.com