• Richard Weinberger's avatar
    UBI: Fastmap: Rework fastmap error paths · 5ca97ad8
    Richard Weinberger authored
    If UBI is unable to write the fastmap to the device
    we have make sure that upon next attach UBI will fall
    back to scanning mode.
    In case we cannot ensure that they only thing we can do
    is falling back to read-only mode.
    
    The current error handling code is not powercut proof.
    It could happen that a powercut while invalidating would
    lead to a state where an too old fastmap could be used upon
    attach.
    This patch addresses the issue by writing a fake fastmap
    super block to a fresh PEB instead of reerasing the existing one.
    The fake fastmap super block will UBI case to do a full scan.
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    5ca97ad8
fastmap.c 37.8 KB