Skip site navigation (1)Skip section navigation (2)
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ão Carlos Mendes Luís wrote:
> I think I may have found the problem!!!
> 
> Looking at the source code for arstrategy, we can find this:
> 
> -----------------------------
> static void
> arstrategy(struct bio *bp)
> {
>     struct ar_softc *rdp = bp->bio_disk->d_drv1;
>     int blkno, count, chunk, lba, lbs, tmplba;
>     int drv = 0, change = 0;
>     caddr_t data;
> -----------------------------
> 
> That is, lba is an int, 32 bits!
> 
> Right below, this variable is used into a bio_pblkno, which is defined
> at <sys/bio.h> as (daddrt_t):
> 
> -----------------------------
>         buf1->bp.bio_pblkno = lba;
>         if ((buf1->drive = drv) > 0)
>             buf1->bp.bio_pblkno += rdp->offset;
> -----------------------------
> 
> 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
> 
> 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.
> 
> 
> 
> Hope I am wrong, but if not, this may be the bug I´ve been chasing since
> 5.2-R.
> 
> 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 
to test if thats whats hurting you.

If you want to take this further you should try out the ATA mkIII 
patches on http://people.freebsd.org/~sos/ATA as that is my corrections 
to whats in RELENG_5...

-- 

-Søren




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42715B29.3000905>