mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
f2fs: allow to recover node blocks given updated checkpoint
If fsck.f2fs changes crc, we have no way to recover some inode blocks by roll- forward recovery. Let's relax the condition to recover them. Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
This commit is contained in:
parent
37a086f015
commit
f236792311
3 changed files with 6 additions and 0 deletions
|
|
@ -1157,6 +1157,7 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
|||
|
||||
/* set this flag to activate crc|cp_ver for recovery */
|
||||
__set_ckpt_flags(ckpt, CP_CRC_RECOVERY_FLAG);
|
||||
__clear_ckpt_flags(ckpt, CP_NOCRC_RECOVERY_FLAG);
|
||||
|
||||
spin_unlock_irqrestore(&sbi->cp_lock, flags);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -305,6 +305,10 @@ static inline bool is_recoverable_dnode(struct page *page)
|
|||
struct f2fs_checkpoint *ckpt = F2FS_CKPT(F2FS_P_SB(page));
|
||||
__u64 cp_ver = cur_cp_version(ckpt);
|
||||
|
||||
/* Don't care crc part, if fsck.f2fs sets it. */
|
||||
if (__is_set_ckpt_flags(ckpt, CP_NOCRC_RECOVERY_FLAG))
|
||||
return (cp_ver << 32) == (cpver_of_node(page) << 32);
|
||||
|
||||
if (__is_set_ckpt_flags(ckpt, CP_CRC_RECOVERY_FLAG))
|
||||
cp_ver |= (cur_cp_crc(ckpt) << 32);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue