Date: Thu, 28 Apr 2005 23:52:41 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= <sos@DeepCore.dk> To: =?ISO-8859-1?Q?Jo=E3o_Carlos_Mendes_Lu=EDs?= <jonny@jonny.eng.br> Cc: sos@FreeBSD.ORG Subject: Re: URGENT for 5.4-R: ATA meister, read this now - 64/32 bits error found - Trouble with ataraid Message-ID: <42715B29.3000905@DeepCore.dk> In-Reply-To: <42714EC6.9030105@jonny.eng.br> References: <426D6087.7080908@jonny.eng.br> <42714536.4020703@jonny.eng.br> <42714EC6.9030105@jonny.eng.br>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/bio.h> 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 > <sys/types.h>, (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 <sys/blist.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42715B29.3000905>