From owner-freebsd-geom@FreeBSD.ORG Sun Aug 19 20:10:06 2007 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABA9516A421 for ; Sun, 19 Aug 2007 20:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8EB13C45D for ; Sun, 19 Aug 2007 20:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l7JKA6P9029291 for ; Sun, 19 Aug 2007 20:10:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l7JKA686029288; Sun, 19 Aug 2007 20:10:06 GMT (envelope-from gnats) Date: Sun, 19 Aug 2007 20:10:06 GMT Message-Id: <200708192010.l7JKA686029288@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: Graham Cc: Subject: Re: kern/115572: ata disk bug X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Graham List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2007 20:10:06 -0000 The following reply was made to PR kern/115572; it has been noted by GNATS. From: Graham To: "Søren" Schmidt Cc: bug-followup@FreeBSD.org, Poul-Henning Kamp Subject: Re: kern/115572: ata disk bug Date: Sun, 19 Aug 2007 13:03:21 -0700 (PDT) thanks Søren.... --- Søren Schmidt wrote: > Poul-Henning Kamp wrote: > > In message <200708182120.l7ILKBvF046099@freefall.freebsd.org>, > Graham writes: > > > > > >> 2. attempt (say).... > >> rabbit# dd if=/dev/zero of=/dev/ad4s1 oseek=2097151 count=1 bs=64k > >> and the result is.... > >> dd: /dev/ad4s1: Input/output error > >> 1+0 records in > >> 0+0 records out > >> 0 bytes transferred in 0.000325 secs (0 bytes/sec) > >> > >> (If dd is performed on the raw drive, /dev/ad4 then block boundary > is > >> always a power of 2, and blocksize a smaller power of 2. That's > always > >> ok. But we can't assume we use drives that way.) > >> > >> So a transfer which starts in the 28-bit zone, but extends over > into > >> the 48-bit region, fails. Such transfers happen in the superblock > of > >> certain size drives, and that plays havoc. The sector mapping of > gbde > >> can do this, but soft-update gets screwed by this happening. It's > not > >> actually to do with the crypto as I first suspected. > >> > > > > This is a problem in the ata disk driver. > > > Yeah, the crossover point from using 28bit to 48bit addressing is > flawed, below patch should fix that: > > --- ata-all.c 23 Feb 2007 16:25:08 -0000 1.279 > +++ ata-all.c 19 Aug 2007 09:25:58 -0000 > @@ -738,7 +738,7 @@ > > atadev->flags &= ~ATA_D_48BIT_ACTIVE; > > - if ((request->u.ata.lba >= ATA_MAX_28BIT_LBA || > + if (((request->u.ata.lba + request->u.ata.count) >= > ATA_MAX_28BIT_LBA || > request->u.ata.count > 256) && > atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) { > > > > -Søren > > > > > > > > > I have compiled with this patch and done an (admittedly superficial) test and the bug is not now visible. I am quite happy to see this one marked as solved. My apologies to P-H.K. for starting off on the wrong tack. Do I need to flag anyone else for this to get taken up in the stock kernel, or will this happen automatic now? regards Graham ____________________________________________________________________________________ Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. http://smallbusiness.yahoo.com/webhosting