Re: [RFC][PATCH] UBI: Make MTD_UBI_FASTMAP non-experimental

From: Richard Weinberger
Date: Tue May 09 2017 - 04:53:24 EST


Jesper,

Am 09.05.2017 um 09:46 schrieb Jesper Nilsson:
> Hi Richard,
>
> I'm still worried about this failure case, do we really
> believe that the flash could fail in such a way that the
> fastmap is corrupted in an undetectable way?
>
> If we do detect corruption we should be no worse off
> than earlier since we should ignore the fastmap, IIRC.

In a perfect world, yes.

> Could you please elaborate on the problem you were
> thinking about?

e.g.
commit 74f2c6e9a47cf4e508198c8594626cc82906a13d
Author: Richard Weinberger <richard@xxxxxx>
Date: Tue Jun 14 10:12:17 2016 +0200

ubi: Be more paranoid while seaching for the most recent Fastmap

Since PEB erasure is asynchornous it can happen that there is
more than one Fastmap on the MTD. This is fine because the attach logic
will pick the Fastmap data structure with the highest sequence number.

On a not so well configured MTD stack spurious ECC errors are common.
Causes can be different, bad hardware, wrong operating modes, etc...
If the most current Fastmap renders bad due to ECC errors UBI might
pick an older Fastmap to attach from.
While this can only happen on an anyway broken setup it will show
completely different sympthoms and makes finding the root cause much
more difficult.
So, be debug friendly and fall back to scanning mode of we're facing
an ECC error while scanning for Fastmap.

Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Richard Weinberger <richard@xxxxxx>

> Right now I'm hesitant to use fastmap in any production code,
> even if it works with my current hardware, since there is no
> guarantee that the flash chips won't get replaced with a
> second source option down the line...

Fastmap is an aggressive optimization and makes finding issues much
harder.

Thanks,
//richard