From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0600EC433ED for ; Thu, 22 Apr 2021 04:04:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFEFD61424 for ; Thu, 22 Apr 2021 04:04:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbhDVEEk (ORCPT ); Thu, 22 Apr 2021 00:04:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:43294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbhDVEEi (ORCPT ); Thu, 22 Apr 2021 00:04:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F5B1613CC; Thu, 22 Apr 2021 04:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619064244; bh=vs3ayIaBY68FqZS//4WZP7ftXNR4rRy3qqwmFLiugpo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vKLbE6T5+jN47C/PGbTCN6CmFwsH7i17h/qAlfAM+z7Ar5+qCVPjF9Moyr8DcR8xq E/o818HE1z3zqtK8/s3afrUcPBVWKZ71BsO7FqqdtnDAADgzwpwHHa1MTdkpyBu2gc I71Nr/VjufUu1SzBNDZEptGOnZsUo1okRrWV1tCUSAWgCTqEGQE+NZVLhTLIEMwBgC z9PXv496oiprc6UpvvQtDdpIwDU5wUnyIwpqlGrt93BxOQc6iKxnSucaMaT6XrEm5s z9gRE2cz906bwMOBWGkGsqZMLrCiAy29DYpCRRcj1A+QS117+Tq2JI/HnMSmC7LXEi 7z2B3zUUScbVA== Date: Wed, 21 Apr 2021 21:04:02 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, chao@kernel.org Subject: Re: [PATCH] f2fs: compress: remove unneed check condition Message-ID: References: <20210421083941.66371-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210421083941.66371-1-yuchao0@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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