lkml.org 
[lkml]   [2018]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [f2fs-dev] [PATCH 1/2] f2fs: allow to recover node blocks given updated checkpoint
From
Date
On 2018/1/20 12:26, Jaegeuk Kim wrote:
> 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.

As this is fsck case only, what about writing checkpoint with special flag
for such case, and relax the condition if flag was set, so, for normal case,
it can avoid recovering obsolete data.

Thanks,

>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fs/f2fs/node.h | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h
> index 0ee3e5ff49a3..15280eeb24ea 100644
> --- a/fs/f2fs/node.h
> +++ b/fs/f2fs/node.h
> @@ -305,10 +305,11 @@ 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);
>
> - if (__is_set_ckpt_flags(ckpt, CP_CRC_RECOVERY_FLAG))
> + if (__is_set_ckpt_flags(ckpt, CP_CRC_RECOVERY_FLAG)) {
> cp_ver |= (cur_cp_crc(ckpt) << 32);
> -
> - return cp_ver == cpver_of_node(page);
> + return cp_ver == cpver_of_node(page);
> + }
> + return (cp_ver << 32) == (cpver_of_node(page) << 32);
> }
>
> /*
>

\
 
 \ /
  Last update: 2018-01-20 10:30    [W:0.062 / U:5.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site