• Sascha Hauer's avatar
    ubifs: Do not update inode size in-place in authenticated mode · 1e76592f
    Sascha Hauer authored
    In authenticated mode we cannot fixup the inode sizes in-place
    during recovery as this would invalidate the hashes and HMACs
    we stored for this inode.
    
    Instead, we just write the updated inodes to the journal. We can
    only do this after ubifs_rcvry_gc_commit() is done though, so for
    authenticated mode call ubifs_recover_size() after
    ubifs_rcvry_gc_commit() and not vice versa as normally done.
    
    Calling ubifs_recover_size() after ubifs_rcvry_gc_commit() has the
    drawback that after a commit the size fixup information is gone, so
    when a powercut happens while recovering from another powercut
    we may lose some data written right before the first powercut.
    This is why we only do this in authenticated mode and leave the
    behaviour for unauthenticated mode untouched.
    Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    1e76592f
recovery.c 43.6 KB