• Richard Weinberger's avatar
    ubi: Be more paranoid while seaching for the most recent Fastmap · 53fc3ef2
    Richard Weinberger authored
    commit 74f2c6e9 upstream.
    
    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.
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    [bwh: Backported to 3.16:
     - In scan_fast(), use 'ai' instead of 'scan_ai'
     - Adjust context]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    53fc3ef2
attach.c 47.6 KB