Re: ata_tf_read_block() question

From: Atsushi Nemoto
Date: Sun Aug 16 2009 - 05:34:07 EST


On Sun, 16 Aug 2009 11:15:31 +0900, Tejun Heo <htejun@xxxxxxxxx> wrote:
> > It seems inconsistent. The correct calculation is:
> > block = (cyl * dev->heads + head) * dev->sectors + sect - 1;
> > isn't it?
>
> Yes, indeed.
>
> > I don't have any real problem. Just noticed by code reading.
>
> ata_tf_read_block() currently is used only when reporting failed block
> address to upper layer so off-by-one bug there wouldn't be too
> visible, especially for the venerable CHS addressing.

Thank you for checking.

> Care to submit a patch w/ warning message and capping for sect == 0
> case?

Well, I expect fix by you (or other libata hackers) since I think you
can write better warning message and changelog than me ;)

---
Atsushi Nemoto
--
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/