linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Ritesh Harjani <riteshh@codeaurora.org>,
	linux-f2fs-devel@lists.sourceforge.net, jaegeuk@kernel.org
Subject: Re: [PATCH 2/2] f2fs: Set CP_ERROR_FLAG in case of inconsistent node page entries
Date: Mon, 19 Nov 2018 15:15:14 +0800	[thread overview]
Message-ID: <b3414466-789f-7b2e-8ef0-60288210a33b@huawei.com> (raw)
In-Reply-To: <1542607377-25446-2-git-send-email-riteshh@codeaurora.org>

Hi Ritesh,

On 2018/11/19 14:02, Ritesh Harjani wrote:
> In case of any inconsistent node page entries found,
> call f2fs_stop_checkpoint to further avoid any corruption.
> 
> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
> ---
>  fs/f2fs/node.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index d338740..29b56ef 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -1369,6 +1369,7 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
>  			ofs_of_node(page), cpver_of_node(page),
>  			next_blkaddr_of_node(page));
>  		err = -EINVAL;
> +		f2fs_stop_checkpoint(sbi, false);

I think it needs more information to proof filesystem-level metadata is
corrupted, otherwise it only indicate that current node is corrupted...

I guess that we can verify ni.blk_addr validity in SIT to check consistent
between NAT and SIT, then we can decide to stop checkpoint?

BTW, I suspect there is still app/system program bypass filesystem and use
block layer interface to operate data partition directly, e.g. fiemap/bmap
+ write blkaddr, since block migration during f2fs GC, such operation
should be avoided. :)

Thanks,

>  out_err:
>  		ClearPageUptodate(page);
>  		f2fs_put_page(page, 1);
> 

  reply	other threads:[~2018-11-19  7:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19  6:02 [PATCH 1/2] f2fs: remove stale inode entry before eviction from gdirty_list Ritesh Harjani
2018-11-19  6:02 ` [PATCH 2/2] f2fs: Set CP_ERROR_FLAG in case of inconsistent node page entries Ritesh Harjani
2018-11-19  7:15   ` Chao Yu [this message]
2018-11-19  6:39 ` [PATCH 1/2] f2fs: remove stale inode entry before eviction from gdirty_list Chao Yu
     [not found]   ` <c5387fdb-6b20-ed3d-e9a5-ae55b5dbdd37@codeaurora.org>
2018-11-19 21:03     ` Jaegeuk Kim
2018-11-20 10:33       ` Ritesh Harjani
2018-11-21  3:30         ` Chao Yu
2018-11-23 11:07           ` Ritesh Harjani
2018-11-24  9:55             ` Chao Yu
2019-08-07  2:28         ` [f2fs-dev] " Jaegeuk Kim

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=b3414466-789f-7b2e-8ef0-60288210a33b@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=riteshh@codeaurora.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;
as well as URLs for NNTP newsgroup(s).