linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: twebb <taliaferro62@gmail.com>
Cc: Lei Wen <leiwen@marvell.com>, linux-mtd@lists.infradead.org
Subject: Re: ubifs_scan() error handling
Date: Tue, 13 Jul 2010 07:28:09 +0300	[thread overview]
Message-ID: <1278995289.16634.126.camel@localhost> (raw)
In-Reply-To: <AANLkTilwqK96Btosh4kzW0kMDjRWzWskrG_ymekpV9Uz@mail.gmail.com>

On Wed, 2010-06-23 at 13:04 -0400, twebb wrote:
> Without having a complete understanding of how the UBI and UBIFS
> internals work, I have a question regarding error handling in
> ubifs_scan().
> 
> When ubifs_scan() encounters SCANNED_EMPTY_SPACE during execution, it
> checks whether the LEB is all 0xFFs and if not - returns -EUCLEAN.

Yes, because it UBIFS always writes to LEBs from the beginning to the
end, node by node. Then, when power cut happens, it should have
something like

LEB: | good nodes | a broken node | 0xFFs |

this is what it checks. If it does not see 0xFFs, this is some unknow
situation for UBIFS and it prefers to refuse the flash.

In MLC case, you may have bit-flips. So you need to teach UBIFS to
accept 0xFFs + bitflips.

>   In
> some cases (for example, in orphan.c/kill_orphans()), any error
> returned by ubifs_scan() results in a call to ubifs_recover_leb().

I need to look closer, but looks like we just forgot to check the
need_recovery flag.

> Would it make sense and be acceptable to make this call any time
> ubifs_scan() returns an error? 

May be. I'll think and return to you.

>  And if so, would it make more sense to
> include the ubifs_recover_leb() call in ubifs_scan() at goto
> corruption?

Also need to think.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  reply	other threads:[~2010-07-13  4:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 17:04 ubifs_scan() error handling twebb
2010-07-13  4:28 ` Artem Bityutskiy [this message]
2010-07-13  4:32   ` Artem Bityutskiy
2011-01-28 17:13     ` twebb
2011-01-29 17:38       ` Artem Bityutskiy
2011-02-01  1:26         ` twebb
2011-02-06 14:58           ` 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=1278995289.16634.126.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=leiwen@marvell.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=taliaferro62@gmail.com \
    /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).