From owner-freebsd-geom@FreeBSD.ORG Sun Aug 19 09:28:27 2007 Return-Path: Delivered-To: freebsd-geom@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFC3416A41A for ; Sun, 19 Aug 2007 09:28:27 +0000 (UTC) (envelope-from sos@deepcore.dk) Received: from spider.deepcore.dk (cpe.atm2-0-70484.0x50a6c9a6.abnxx16.customer.tele.dk [80.166.201.166]) by mx1.freebsd.org (Postfix) with ESMTP id 878B913C481 for ; Sun, 19 Aug 2007 09:28:27 +0000 (UTC) (envelope-from sos@deepcore.dk) Received: from ws.deepcore.dk (ws.deepcore.dk [194.192.25.137]) by spider.deepcore.dk (8.13.8/8.13.8) with ESMTP id l7J9SQux089903; Sun, 19 Aug 2007 11:28:26 +0200 (CEST) (envelope-from sos@deepcore.dk) Message-ID: <46C80D3A.4020507@deepcore.dk> Date: Sun, 19 Aug 2007 11:28:26 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Poul-Henning Kamp References: <83156.1187508376@critter.freebsd.dk> In-Reply-To: <83156.1187508376@critter.freebsd.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Cc: Graham , freebsd-geom@FreeBSD.ORG Subject: Re: kern/115572: ata disk bug X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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 09:28:28 -0000 Poul-Henning Kamp wrote: > In message <200708182120.l7ILKBvF046099@freefall.freebsd.org>, Graham w= rites: > > =20 >> 2. attempt (say).... >> rabbit# dd if=3D/dev/zero of=3D/dev/ad4s1 oseek=3D2097151 count=3D1 bs= =3D64k >> 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 alway= s >> 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. >> =20 > > This is a problem in the ata disk driver. > =20 Yeah, the crossover point from using 28bit to 48bit addressing is=20 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 @@ =20 atadev->flags &=3D ~ATA_D_48BIT_ACTIVE; =20 - if ((request->u.ata.lba >=3D ATA_MAX_28BIT_LBA || + if (((request->u.ata.lba + request->u.ata.count) >=3D=20 ATA_MAX_28BIT_LBA || request->u.ata.count > 256) && atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) { =20 -S=F8ren > > > =20