• Jaegeuk Kim's avatar
    f2fs: fix roll-forward missing scenarios · 441ac5cb
    Jaegeuk Kim authored
    We can summarize the roll forward recovery scenarios as follows.
    
    [Term] F: fsync_mark, D: dentry_mark
    
    1. inode(x) | CP | inode(x) | dnode(F)
    -> Update the latest inode(x).
    
    2. inode(x) | CP | inode(F) | dnode(F)
    -> No problem.
    
    3. inode(x) | CP | dnode(F) | inode(x)
    -> Recover to the latest dnode(F), and drop the last inode(x)
    
    4. inode(x) | CP | dnode(F) | inode(F)
    -> No problem.
    
    5. CP | inode(x) | dnode(F)
    -> The inode(DF) was missing. Should drop this dnode(F).
    
    6. CP | inode(DF) | dnode(F)
    -> No problem.
    
    7. CP | dnode(F) | inode(DF)
    -> If f2fs_iget fails, then goto next to find inode(DF).
    
    8. CP | dnode(F) | inode(x)
    -> If f2fs_iget fails, then goto next to find inode(DF).
       But it will fail due to no inode(DF).
    
    So, this patch adds some missing points such as #1, #5, #7, and #8.
    Signed-off-by: default avatarHuang Ying <ying.huang@intel.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    441ac5cb
recovery.c 13.3 KB