• Artem Bityutskiy's avatar
    UBIFS: fix extremely rare mount failure · bbf2b37a
    Artem Bityutskiy authored
    This patch fixes an extremely rare mount failure after a power cut, when mount
    fails with ENOSPC error because UBIFS could not find the GC LEB.
    
    In short, the reason for this failure is that after recovery the GC head LEB
    contains less free space than it had contained just before the power cut
    happened. As a result, if the FS is full, 'ubifs_rcvry_gc_commit()' is unable
    to find a dirty LEB to GC and a free LEB, so mount fails.
    
    This patch contains a huge comment with more detailed explanation, please refer
    that comment.
    
    Since this is really really rare and unlikely situation, I do not send this
    patch to the stable tree, also because it requires a lot of preparation
    patches which I did before. So sending this to -stable would be too risky.
    Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
    bbf2b37a
recovery.c 42.8 KB