linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Zhang Qilong <zhangqilong3@huawei.com>, jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH -next] f2fs: fix race condition on setting FI_NO_EXTENT flag
Date: Tue, 6 Sep 2022 11:27:42 +0800	[thread overview]
Message-ID: <52a9d745-1039-a596-95f1-98e1c35ab62e@kernel.org> (raw)
In-Reply-To: <20220905045917.7520-1-zhangqilong3@huawei.com>

On 2022/9/5 12:59, Zhang Qilong wrote:
> The following scenarios exist.
> process A:               process B:
> ->f2fs_drop_extent_tree  ->f2fs_update_extent_cache_range
>                            ->f2fs_update_extent_tree_range
>                             ->write_lock
>   ->set_inode_flag
>                             ->is_inode_flag_set
>                             ->__free_extent_tree // Shouldn't
>                                                  // have been
>                                                  // cleaned up
>                                                  // here
>    ->write_lock
> 
> In this case, the "FI_NO_EXTENT" flag is set between
> f2fs_update_extent_tree_range and is_inode_flag_set
> by other process. it leads to clearing the whole exten
> tree which should not have happened. And we fix it by
> move the setting it to the range of write_lock.
> 
> Fixes:5f281fab9b9a3 ("f2fs: disable extent_cache for fcollapse/finsert inodes")
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

      reply	other threads:[~2022-09-06  3:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05  4:59 [f2fs-dev] [PATCH -next] f2fs: fix race condition on setting FI_NO_EXTENT flag Zhang Qilong via Linux-f2fs-devel
2022-09-06  3:27 ` Chao Yu [this message]

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=52a9d745-1039-a596-95f1-98e1c35ab62e@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=zhangqilong3@huawei.com \
    /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).