Subject: Re: LBA48_THRESHOLD
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 01/15/2005 23:29:22
>> You mean, wd->sc-wdc_bio.blkno >= LBA-reported-size?

> Yes. More specifically, I mean remplace
>         if (wd->sc_flags & WDF_LBA48 &&
> 	    (wd->sc_wdc_bio.blkno > LBA48_THRESHOLD ||
> 	    (wd->sc_quirks & WD_QUIRK_FORCE_LBA48) != 0))
> with
> 	if (wd->sc_flags & WDF_LBA48 &&
> 	    wd->sc_wdc_bio.blkno > LBA-reported-size)

I would hope you actually mean >= rather than > in the last line, or
you will always be trying to access the first non-LBA sector via LBA.
(If LBA reports N sectors, that means sectors 0 through N-1 should use
LBA, with N and higher going to LBA48.)  You'll also need to save the
LBA-reported size somewhere for LBA48 disks, but that's easy enough to
arrange.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B