UBIFS: recovery of master node

Richard Genoud richard.genoud at gmail.com
Fri Jul 17 01:59:49 PDT 2015


2015-07-17 10:10 GMT+02:00 Richard Weinberger <richard at nod.at>:
> Am 17.07.2015 um 10:04 schrieb Andrea Scian:
>>
>> Dear Richard,
>>
>> Il 17/07/2015 09:24, Richard Weinberger ha scritto:
>>> Am 17.07.2015 um 08:58 schrieb Andrea Scian:
>>>> Il 16/07/2015 17:29, Richard Weinberger ha scritto:
>>>>> Andrea,
>>>>>
>>>>> On Thu, Jul 16, 2015 at 3:22 PM, Andrea Scian <rnd4 at dave-tech.it> wrote:
>>>>>>
>>>>>> 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?
>>>>
>>>> Another UBI/UBIFS "implementation" question: are there some other places,
>>>> apart from get_master_node(),
>>>> where UBIFS check empty space corruption and fails
>>>> badly if something wrong?
>>>
>>> Having non-corrupted empty space is a fundamental requirement of UBIFS.
>>> If you patch it out you'll hurt UBIFS's ability to recover from a power cut.
>>> Someone tried to do so already.
>>
>> Thanks, this are the internals of UBIFS I'm not aware of, and for this I'm asking the experts :-)
>>
>>> I know, cheap modern NAND, especially MLC seems to show bitflips also on empty pages.
>>> Not all NAND controllers can deal with that and will just return an uncorrectable ECC error
>>> upon reading.
>>
>> Is the any NAND controller able to do so? ;-)
>
> TBH, I don't know. :-)
The atmel nand controllers since SAMA5 can do that (and that quite easy to do) :
All they have to do is set an XOR value at the end of the ECC
computation so that ECC(blank_page)==0xFFFFFFFFF...
(maybe it's more complicated that that, but that's the idea).

As far as I've seen, the actual implementation (in atmel_nand for
chips >SAMA5) is buggy :
http://lxr.free-electrons.com/source/drivers/mtd/nand/atmel_nand.c#L857
If the ECC is all FF, the page is considered to be a blank page (but
it's not memset-ed to 0)
and a bitflip in the ecc area is not handled either.

I didn't have time to rebound on Brian's patch proposal yet (
http://patchwork.ozlabs.org/patch/328994/ ) but it's clear that we
have to do something to address that.
At least, UBIFS is screaming out loud when a blank page is not blank !
others FS may just write corrupted data...


Richard.



More information about the linux-mtd mailing list