From owner-freebsd-scsi@FreeBSD.ORG Tue Jul 3 18:42:21 2012 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86DB51065670 for ; Tue, 3 Jul 2012 18:42:21 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout2-b.corp.bf1.yahoo.com (mrout2-b.corp.bf1.yahoo.com [98.139.253.105]) by mx1.freebsd.org (Postfix) with ESMTP id 49CEA8FC08 for ; Tue, 3 Jul 2012 18:42:21 +0000 (UTC) Received: from [IPv6:::1] (rideseveral.corp.yahoo.com [10.73.160.231]) by mrout2-b.corp.bf1.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id q63Ifv7k041885; Tue, 3 Jul 2012 11:41:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yahoo-inc.com; s=cobra; t=1341340918; bh=9PGzXkP2GvEGWAaPa7vLkGpQhXSAvoqjatI6BashtAk=; h=Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Content-Transfer-Encoding; b=SULppmPf5DgXZeTss3VB7nWGVrZmSSM16/bkqw3Xf/LPqKpzekGcpOYEYkvspAj6+ mxdmfq4H4QPc3Q8pICUtpKW4CP/zZ+/FLb0cI3FG/LotB3g5x5VItPWJa8uvqh5t/r rdqoAR5NWp/zU1Adb0GjBek8kFixxAIJNs6ajQuE= From: Sean Bruno To: Andrew Boyer In-Reply-To: <909AAC62-7BB4-43E7-B04B-27466B038A07@averesystems.com> References: <909AAC62-7BB4-43E7-B04B-27466B038A07@averesystems.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 03 Jul 2012 11:41:56 -0700 Message-ID: <1341340916.3370.6.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Milter-Version: master.31+4-gbc07cd5+ X-CLX-ID: 340917003 Cc: "freebsd-scsi@freebsd.org" Subject: Re: [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 18:42:21 -0000 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(). > > -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 > This looks right to me. It mirrors the behavior in mfi_disk_strategy() as well. Sean