From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, chao@kernel.org
Subject: Re: [PATCH] f2fs: compress: remove unneed check condition
Date: Wed, 21 Apr 2021 21:04:02 -0700 [thread overview]
Message-ID: <YID1sqemJVeBcdqD@google.com> (raw)
In-Reply-To: <20210421083941.66371-1-yuchao0@huawei.com>
On 04/21, Chao Yu wrote:
> In only call path of __cluster_may_compress(), __f2fs_write_data_pages()
> has checked SBI_POR_DOING condition, and also cluster_may_compress()
> has checked CP_ERROR_FLAG condition, so remove redundant check condition
> in __cluster_may_compress() for cleanup.
I think cp_error can get any time without synchronization. Is it safe to say
it's redundant?
>
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> ---
> fs/f2fs/compress.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
> index 3c9d797dbdd6..532c311e3a89 100644
> --- a/fs/f2fs/compress.c
> +++ b/fs/f2fs/compress.c
> @@ -906,11 +906,6 @@ static bool __cluster_may_compress(struct compress_ctx *cc)
>
> f2fs_bug_on(sbi, !page);
>
> - if (unlikely(f2fs_cp_error(sbi)))
> - return false;
> - if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
> - return false;
> -
> /* beyond EOF */
> if (page->index >= nr_pages)
> return false;
> --
> 2.29.2
next prev parent reply other threads:[~2021-04-22 4:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 8:39 [PATCH] f2fs: compress: remove unneed check condition Chao Yu
2021-04-22 4:04 ` Jaegeuk Kim [this message]
2021-04-22 6:51 ` Chao Yu
2021-04-25 0:47 ` Jaegeuk Kim
2021-04-25 1:28 ` Chao Yu
2021-04-26 17:05 ` Jaegeuk Kim
2021-04-27 2:43 ` 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=YID1sqemJVeBcdqD@google.com \
--to=jaegeuk@kernel.org \
--cc=chao@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=yuchao0@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).