From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Albert Lee <albertcc@tw.ibm.com>
Cc: Jeff Garzik <jgarzik@pobox.com>,
Linux IDE <linux-ide@vger.kernel.org>,
Doug Maxey <dwm@maxeymade.com>
Subject: Re: [PATCH 1/4] sg traverse fix for __atapi_pio_bytes()
Date: Mon, 6 Jun 2005 11:24:26 +0200 [thread overview]
Message-ID: <58cb370e05060602241afa7175@mail.gmail.com> (raw)
In-Reply-To: <42A40193.3090500@tw.ibm.com>
Hi,
On 6/6/05, Albert Lee <albertcc@tw.ibm.com> wrote:
> Hi Jeff,
>
> Problem:
> Incorrect md5sum when using ATAPI PIO mode to verify a distro CD.
>
> Root cause:
> sg traverse problem.
> In __atapi_pio_bytes(), if qc->cursg++ is increased and "goto next_page" is executed,
> then sg is not updated to the new qc->cursg and the old sg is overwritten with the new data.
>
> Changes:
> - Replace "goto next_page" with "goto next_sg" to make sg updated.
>
> Attached please find the patch against the linux-2.6.git tree for your review. Thanks.
>
> Albert
>
> Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
>
>
>
> --- 10_atapi_pio_fix/drivers/scsi/libata-core.c 2005-06-06 13:37:50.000000000 +0800
> +++ 11_atapi_pio_sg_fix/drivers/scsi/libata-core.c 2005-06-06 13:45:33.000000000 +0800
> @@ -2577,7 +2577,6 @@
> next_sg:
> sg = &qc->sg[qc->cursg];
>
> -next_page:
> page = sg->page;
> offset = sg->offset + qc->cursg_ofs;
>
> @@ -2585,6 +2584,7 @@
> page = nth_page(page, (offset >> PAGE_SHIFT));
> offset %= PAGE_SIZE;
>
> + /* don't overrun current sg */
> count = min(sg->length - qc->cursg_ofs, bytes);
>
> /* don't cross page boundaries */
> @@ -2609,8 +2609,6 @@
> kunmap(page);
>
> if (bytes) {
> - if (qc->cursg_ofs < sg->length)
> - goto next_page;
> goto next_sg;
> }
> }
>
Looks good. Jeff, please apply.
Ack-ed by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Minor CodingStyle nitpick - braces can be dropped:
if (bytes)
goto next_sg;
Bartlomiej
next prev parent reply other threads:[~2005-06-06 9:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-06 7:47 [PATCH 0/4] Resubmit ATAPI PIO mode fixes Albert Lee
2005-06-06 7:56 ` [PATCH 1/4] sg traverse fix for __atapi_pio_bytes() Albert Lee
2005-06-06 9:24 ` Bartlomiej Zolnierkiewicz [this message]
2005-06-06 7:58 ` [PATCH 2/4] if condition " Albert Lee
2005-06-06 9:32 ` Bartlomiej Zolnierkiewicz
2005-06-08 3:47 ` Albert Lee
2005-06-08 9:48 ` Bartlomiej Zolnierkiewicz
2005-06-08 11:58 ` Albert Lee
2005-06-08 13:33 ` Bartlomiej Zolnierkiewicz
2005-06-09 4:05 ` Albert Lee
2005-06-09 6:54 ` Bartlomiej Zolnierkiewicz
2005-06-08 13:39 ` Bartlomiej Zolnierkiewicz
2005-06-06 7:59 ` [PATCH 3/4] trailing data handling " Albert Lee
2005-06-06 9:37 ` Bartlomiej Zolnierkiewicz
2005-06-06 8:01 ` [PATCH 4/4] odd length data handling " Albert Lee
2005-06-06 9:39 ` Bartlomiej Zolnierkiewicz
[not found] ` <42A7ED91.4090008@pobox.com>
2005-06-10 6:08 ` [PATCH 0/4] Resubmit ATAPI PIO mode fixes Albert Lee
2005-06-10 7:38 ` [PATCH 2/4] libata: if condition fix for __atapi_pio_bytes() Albert Lee
2005-06-10 7:56 ` Bartlomiej Zolnierkiewicz
2005-06-10 8:31 ` Albert Lee
2005-06-10 7:44 ` [PATCH 3/4] libata: trailing data handling " Albert Lee
2005-06-10 7:46 ` [PATCH 4/4] libata: odd length data handling " Albert Lee
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=58cb370e05060602241afa7175@mail.gmail.com \
--to=bzolnier@gmail.com \
--cc=albertcc@tw.ibm.com \
--cc=dwm@maxeymade.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).