All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: "Fryar, Jeff" <jeff.fryar@hp.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [BUG] mtd-utils: nandwrite: invalid erase after page write failure
Date: Fri, 19 Aug 2011 20:02:58 +0300	[thread overview]
Message-ID: <1313773387.6607.83.camel@sauron> (raw)
In-Reply-To: <EBEBA6C3BD40EF4B8C0A5B8AD5A28F993B6C6EB71A@GVW0547EXC.americas.hpqcorp.net>

On Thu, 2011-08-11 at 16:30 +0100, Fryar, Jeff wrote:
> mtd-utils nandwrite.c: After a page write failure, the calculation
> of the block number to erase is incorrect.  The erase block size is 
> being passed as the erase block number in the call to mtd_erase().
> 
> Jeff Fryar <jeff.fryar@hp.com>
> 
> 
> --- mtd-utils-f1fe865/nandwrite.c.ORIG  2011-07-20 00:28:52.000000000 -0500
> +++ mtd-utils-f1fe865/nandwrite.c       2011-08-11 09:19:12.000000000 -0500
> @@ -659,7 +659,7 @@
>                         fprintf(stderr, "Erasing failed write from %#08llx to %#08llx\n",
>                                 blockstart, blockstart + ebsize_aligned - 1);
>                         for (i = blockstart; i < blockstart + ebsize_aligned; i += mtd.eb_size) {
> -                               if (mtd_erase(mtd_desc, &mtd, fd, mtd.eb_size)) {
> +                               if (mtd_erase(mtd_desc, &mtd, fd, (i/mtd.eb_size))) {

Looks like correct fix, thanks! Your patch is not very well formatted,
but I've amended it and applied to mtd-utils, thanks!

-- 
Best Regards,
Artem Bityutskiy

  parent reply	other threads:[~2011-08-19 17:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 15:30 [BUG] mtd-utils: nandwrite: invalid erase after page write failure Fryar, Jeff
2011-08-11 15:39 ` Mike Frysinger
2011-08-17  4:42   ` Fryar, Jeff
2011-08-19 17:08   ` Artem Bityutskiy
2011-08-19 17:02 ` Artem Bityutskiy [this message]
2011-08-19 17:22   ` Brian Norris
2011-08-19 18:13     ` Artem Bityutskiy
2011-08-19 18:47       ` Brian Norris

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=1313773387.6607.83.camel@sauron \
    --to=dedekind1@gmail.com \
    --cc=jeff.fryar@hp.com \
    --cc=linux-mtd@lists.infradead.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.