From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 28 21:54:40 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A57716A4CE; Thu, 28 Apr 2005 21:54:40 +0000 (GMT) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E7FB43D1F; Thu, 28 Apr 2005 21:54:39 +0000 (GMT) (envelope-from sos@DeepCore.dk) Received: from [194.192.25.143] (laptop.deepcore.dk [194.192.25.143]) by spider.deepcore.dk (8.13.3/8.13.3) with ESMTP id j3SLrGX6022186; Thu, 28 Apr 2005 23:53:17 +0200 (CEST) (envelope-from sos@DeepCore.dk) Message-ID: <42715B29.3000905@DeepCore.dk> Date: Thu, 28 Apr 2005 23:52:41 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Mozilla Thunderbird 1.0 (X11/20050116) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Jo=E3o_Carlos_Mendes_Lu=EDs?= References: <426D6087.7080908@jonny.eng.br> <42714536.4020703@jonny.eng.br> <42714EC6.9030105@jonny.eng.br> In-Reply-To: <42714EC6.9030105@jonny.eng.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-mail-scanned: by DeepCore Virus & Spam killer v1.12 cc: hackers@FreeBSD.ORG cc: sos@FreeBSD.ORG Subject: Re: URGENT for 5.4-R: ATA meister, read this now - 64/32 bits error found - Trouble with ataraid X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2005 21:54:40 -0000 Jo=E3o Carlos Mendes Lu=EDs wrote: > I think I may have found the problem!!! >=20 > Looking at the source code for arstrategy, we can find this: >=20 > ----------------------------- > static void > arstrategy(struct bio *bp) > { > struct ar_softc *rdp =3D bp->bio_disk->d_drv1; > int blkno, count, chunk, lba, lbs, tmplba; > int drv =3D 0, change =3D 0; > caddr_t data; > ----------------------------- >=20 > That is, lba is an int, 32 bits! >=20 > Right below, this variable is used into a bio_pblkno, which is defined > at as (daddrt_t): >=20 > ----------------------------- > buf1->bp.bio_pblkno =3D lba; > if ((buf1->drive =3D drv) > 0) > buf1->bp.bio_pblkno +=3D rdp->offset; > ----------------------------- >=20 > But note that at the /sys/dev/ata/ata-all.h file, the > ata_request.u.ata.lba is defined as (u_int64_t). Also, at > , (daddr_t) is defined as (__int64_t). These are the data= > types used at ata-disk.c >=20 > BTW: While searching for this bug, I found that a type (u_daddr_t) is > defined at as (u_int32_t). I did not care for it right > now, but maybe this should be checked also. >=20 >=20 >=20 > Hope I am wrong, but if not, this may be the bug I=B4ve been chasing si= nce > 5.2-R. >=20 > To probe further: Should the ata-raid driver be allowed to write the > disk at will? I did not even try to mount any partition, but it did > overwrote my data. Maybe to update the raid information. I'm not sure= , > I did not search for this yet. With a 250G disk you are not even close to using 32bits of LBA space, so = thats not your problem. You could just leave ataraid out of your kernel=20 to test if thats whats hurting you. If you want to take this further you should try out the ATA mkIII=20 patches on http://people.freebsd.org/~sos/ATA as that is my corrections=20 to whats in RELENG_5... --=20 -S=F8ren