All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
To: htejun@gmail.com
Cc: jgarzik@pobox.com, linux-ide@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: ata_tf_read_block() question
Date: Sun, 16 Aug 2009 18:33:55 +0900 (JST)	[thread overview]
Message-ID: <20090816.183355.89035427.anemo@mba.ocn.ne.jp> (raw)
In-Reply-To: <4A876BC3.3020407@gmail.com>

On Sun, 16 Aug 2009 11:15:31 +0900, Tejun Heo <htejun@gmail.com> 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

  reply	other threads:[~2009-08-16  9:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-15 13:48 ata_tf_read_block() question Atsushi Nemoto
2009-08-16  2:15 ` Tejun Heo
2009-08-16  9:33   ` Atsushi Nemoto [this message]
2009-08-16 12:21     ` [PATCH #upstream-fixes] libata: fix off-by-one error in ata_tf_read_block() Tejun Heo
2009-09-09  1:19       ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090816.183355.89035427.anemo@mba.ocn.ne.jp \
    --to=anemo@mba.ocn.ne.jp \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.