Re: Off-by-one in both LIBATA and IDE drivers

From: Norman Diamond
Date: Thu Mar 12 2009 - 19:02:47 EST


Mark Lord wrote:
> Norman Diamond wrote:
>> Jim Paris wrote:
>>> Norman Diamond wrote:
>>>>
>>>> It looks like both LIBATA and the old IDE drivers
>>>> have an off-by-one error in deciding whether to
>>>> use READ SECTOR(S) instead of READ SECTOR(S) EXT.

I don't know for sure now but the old IDE drivers
might be OK on this matter. When hdparm got errors
I thought they were the driver's fault, but now it's
clear it was hdparm's fault.

It still seems doubtful whether LIBATA is fully fixed.

>>> This was fixed here:
>>>
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=97b697a11b07e2ebfa69c488132596cc5eb24119

(Though that patch doesn't mention two suspicious .c
files that compare sector numbers to expressions
1UL << 28 and 1 << 28.)

>> I'm still having trouble after applying the same
>> patch to 2.6.24.3 (applying it three times in order
>> to build Slax).
>> Does hdparm construct its own taskfiles for ATA and
>> SATA in order to produce an error trying to read
>> sector number 0x0fffffff even after I patched the
>> kernel?
>
> What, *exactly*, do you mean there.

hdparm --read-sector 268435455 /dev/hda
and
hdparm --read-sector 268435455 /dev/sda
still gave errors even after I patched LIBATA in
kernel 2.6.24.3. The exceptions are Western Digital
drives that apparently accept LBA28 instructions on
that sector number.

> Yes, hdparm constructs its own taskfiles for the
> --read-sector subcommand.

Thank you. So I think my build of Slax now will work
except for two obscure chipsets under LIBATA, and will
work for every situation that I'm aware of under the
old IDE drivers (though the old IDE drivers will run
unbearably slowly in some cases).

> Are you hitting these errors with the latest hdparm
> (9.12)?

Sorry, I just checked and it's hdparm 8.6. Anyway
it's a relief to see that I probably have a build
working well enough for present needs, and I just have
to use tools other than that build's version of hdparm
to test it.

--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/