mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: allow to recover node blocks given updated checkpoint
Date: Sat, 20 Jan 2018 17:29:05 +0800	[thread overview]
Message-ID: <a5568772-c2e1-441f-0182-7f226a162226@kernel.org> (raw)
In-Reply-To: <20180120042643.20717-1-jaegeuk@kernel.org>

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);
>  }
>  
>  /*
> 

  parent reply	other threads:[~2018-01-20  9:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-20  4:26 Jaegeuk Kim
2018-01-20  4:26 ` [PATCH 2/2] f2fs: recover some i_inline flags Jaegeuk Kim
2018-01-20  9:33   ` [f2fs-dev] " Chao Yu
2018-01-20 22:06   ` [PATCH 2/2 v2] " Jaegeuk Kim
2018-01-21  2:42     ` [f2fs-dev] " Chao Yu
2018-01-20  9:29 ` Chao Yu [this message]
2018-01-20 22:05 ` [PATCH 1/2 v2] f2fs: allow to recover node blocks given updated checkpoint Jaegeuk Kim
2018-01-21  2:41   ` [f2fs-dev] " Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5568772-c2e1-441f-0182-7f226a162226@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®