Skip to contentSkip to conversation

off-by-1 error in ide-probe (2.4.x)

PATCH [email protected] 3 participants 3 messages Mar 19, 2001

lore
Share & tools
lore
#0 lore raw

On Sun, 18 Mar 2001, Jens Axboe wrote:
>
> The 256 is _not_ a bug in the driver, it's more likely a bug in your > drive. 256 is a perfectly legal transfer size. That said, maybe it is > a good idea to leave it at 255 just for safety on drives not handling > 0 sectors == 128kB transfer.

Agreed. That would be a trivially easy bug in the firmware, limiting to 255 sectors seems safer.

Linus

Yes, possibly.
I checked old standards, and see that "0 means 256 as a sector count" is already in ATA-1.

Is there any evidence that other people have been hit by this? Unfortunately, the
"status error: status=0x58 { DriveReady SeekComplete DataRequest }"
is reported frequently these days, and has many causes. In old reports it is rare. (E.g. none in lk for 1997.)

Paul: is there only one disk that you can make fail this way?

Andries

#1 lore raw
Quoted 9 lines · On Mon, 19 Mar 2001 [email protected] wrote:

Agreed. That would be a trivially easy bug in the firmware, limiting to 255 sectors seems safer.

Linus

Yes, possibly.
I checked old standards, and see that "0 means 256 as a sector count" is already in ATA-1.

Yes. But we could have some silly bug in the Linux drivers too, if some part of the driver reads back the sector count and doesn't do the 0==256 conversion. So let's not blame the disk quite yet. Although it would be interesting to hear if the problem only happens for a specific disk or manufacturer...

Linus

#2 lore raw
Quoted 13 lines · Linus Torvalds
Quoted 9 lines · On Mon, 19 Mar 2001 [email protected] wrote:

Agreed. That would be a trivially easy bug in the firmware, limiting to 255 sectors seems safer.

Linus

Yes, possibly.
I checked old standards, and see that "0 means 256 as a sector count" is already in ATA-1.

Quoted 5 lines

Yes. But we could have some silly bug in the Linux drivers too, if some part of the driver reads back the sector count and doesn't do the 0==256 conversion. So let's not blame the disk quite yet. Although it would be interesting to hear if the problem only happens for a specific disk or manufacturer...

LT,

This is why I want to standardize the data-phase rules, but we have agreed to postpone for 2.5. Since the glue for the main loops is spread like hot butter, it covers up a lot of issues and threads get messy. I had all but given up on chasing them down and then resolved to start from scratch.

Andre Hedrick
Linux ATA Development