From: Andrea Scian <rnd4@dave-tech.it>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: mtd_mailinglist <linux-mtd@lists.infradead.org>
Subject: Re: UBIFS: recovery of master node
Date: Thu, 16 Jul 2015 17:50:09 +0200 [thread overview]
Message-ID: <55A7D2B1.1040203@dave-tech.it> (raw)
In-Reply-To: <CAFLxGvxgKeKq1_cLNG9rS53NDT=OZsO9h6cizBnkU5Zv69EwSQ@mail.gmail.com>
Dear Richard,
Il 16/07/2015 17:29, Richard Weinberger ha scritto:
> Andrea,
>
> On Thu, Jul 16, 2015 at 3:22 PM, Andrea Scian <rnd4@dave-tech.it> wrote:
>> Dear all,
>>
>> I'm trying to understand how UBIFS recovers master node from a corrupted
>> flash (e.g. after power cut during one of the two of master node or due
>> flash corruption itself).
>>
>> IIUC (please correct me if I'm wrong) UBIFS store two copies of master node,
>> in LEB1 and LEB2 (LEB0 is reserved for superblock), ref.
>> http://www.linux-mtd.infradead.org/doc/ubifs_whitepaper.pdf.
>> Inside ubifs_recover_master_node() try to read first LEB1 and, only in case
>> of get_master_node() does NOT return an error, it tries to read LEB2 (ref.
>> fs/ubifs/recovery.c)
>> I'm working with a 3.10 class kernel, but I've found nearly the same code on
>> mainline.
>>
>> On my test-bed, the recovery fails because get_master_node(LEB1) fails
>> (exactly here
>> http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/fs/ubifs/recovery.c#n184)
>> I'm hacking around the code to see what's really happening under the wood,
>> but I'm a UBIFS newbie I would like to ask:
>>
>> 1) why if get_master_node(LEB1) fails we don't ALWAYS look at
>> get_master_node(LEB2)? I think we should try to read LEB2 even if something
>> really bad happens to LEB1.. or not?
> AFAIK the idea was that only upon plausible errors the second LEB will be used.
> If reading LEB1 fails due to an internal MTD error UBIFS gives up.
Understood, I think you already told me that UBI/UBIFS assume that empty
flash always stay empty
However, to me it seems this is a heavy limitation, if we have another
master node, why don't we always try to use it?
Again, I'm just trying to understand the recovery code and try to
improve it (if possible ;-) )
>> 2) if I bypass the get_master_node(LEB1) return value, I found that
>> get_master_node(LEB2) fails too, for the same reason of LEB1 (see above).
>> IIUC we check about empty space because master node pages get written
>> without being erased every time, but I'm still studying this topic ;-)
>>
>> If I bypass that check too, I can mount UBIFS and everything inside the FS
>> is there but, of course, I'm sure I'm doing something that may be wrong..
>>
>> WDYT?
> So, you're facing bitflips on empty space?
Yes, and this seems the same behavior I saw previously regarding factory
bad block marker (ref
http://lists.infradead.org/pipermail/linux-mtd/2015-March/058151.html)
> Is this MLC NAND?
Yes, I'm doing some heavy stress test on it
Kind Regards,
--
Andrea SCIAN
DAVE Embedded Systems
next prev parent reply other threads:[~2015-07-16 15:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-16 13:22 UBIFS: recovery of master node Andrea Scian
2015-07-16 15:29 ` Richard Weinberger
2015-07-16 15:50 ` Andrea Scian [this message]
2015-07-17 6:58 ` Andrea Scian
2015-07-17 7:24 ` Richard Weinberger
2015-07-17 8:04 ` Andrea Scian
2015-07-17 8:10 ` Richard Weinberger
2015-07-17 8:59 ` Richard Genoud
2015-07-17 11:38 ` Artem Bityutskiy
2015-07-17 11:43 ` Richard Weinberger
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=55A7D2B1.1040203@dave-tech.it \
--to=rnd4@dave-tech.it \
--cc=linux-mtd@lists.infradead.org \
--cc=richard.weinberger@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 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.