UBIFS corruption after power cut - possibly unstable bits issue?
Ricard Wanderlof
ricard.wanderlof at axis.com
Tue Nov 3 02:18:57 PST 2015
On Tue, 3 Nov 2015, Michal Suchanek wrote:
> it has been pointed out that this assumption on the part of UBI that
> erased pages are composed of 0xff bytes is just wrong.
>
> Here it is wrong in the sense that the pages are not bit-perfect but
> there are other reasons why it may go wrong.
>
> - if the nand controller uses randomization layer the pages are 0xff
> bytes transformed by the randomization layer
>
> - if MTD grows full-disk encryption then reading a page of 0xff bytes
> will yield what this page decrypts to using current encryption scheme
>
> The layering is wrong here. The MTD core should provide a function to
> check if a physical page is empty and the driver should provide
> driver-specific implementation if needed.
In a sense, doesn't the driver already do that in that an erased page with
bitflips should be corrected by ECC so that there are no bitflips
apparent? If, as many hardware controllers do, the ECC check for an erased
page fails, then the driver should still be able to determine that the
page in question is erased, with bitflips, and should be able to provide a
true 0xff page upward.
I agree though that an erased-page API function would be good too, as it
moves the guesswork to the right place (the actual driver).
/Ricard
--
Ricard Wolf Wanderlöf ricardw(at)axis.com
Axis Communications AB, Lund, Sweden www.axis.com
Phone +46 46 272 2016 Fax +46 46 13 61 30
More information about the linux-mtd
mailing list