Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Joel Reardon <joel@clambassador.com>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: determining if a block erasure failed
Date: Tue, 15 May 2012 14:40:53 +0300	[thread overview]
Message-ID: <1337082053.2528.182.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1205150944550.17750@eristoteles.iwoars.net>

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

On Tue, 2012-05-15 at 09:53 +0200, Joel Reardon wrote:
> I want the caller of erase_worker() to be aware if the erase block became
> bad. Here is the relevant code at the end of erase_worker():
> 
> /* at this time, the erase has failed. err == -EIO */
>         ubi_msg("mark PEB %d as bad", pnum);
>         err = ubi_io_mark_bad(ubi, pnum);
>         if (err)
>                 goto out_ro;
> 
> /* does other stuff, not touching err */
> 
> /* err == 0 here, because of above goto */
>         return err;
> 
> out_ro:
>         ubi_ro_mode(ubi);
>         return err;
> 
> 
> So, if this function should return zero when the erase block fails, then I
> will add a "result" field to ubi_work that will store the result of the
> work function. But I figured I'd check first if the return err that always
> returns 0 is not an oversight and this function should return -EIO if it
> fails.

Why do you need the results?

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-05-15 11:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15  7:53 determining if a block erasure failed Joel Reardon
2012-05-15 11:40 ` Artem Bityutskiy [this message]
2012-05-15 11:56   ` Joel Reardon
2012-05-15 12:22     ` Artem Bityutskiy

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=1337082053.2528.182.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=joel@clambassador.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox