Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp130954pxy; Wed, 21 Apr 2021 21:05:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbSB+Ix5hlqUcI3oGQy3vlgSHwEmyHyHO1cFr67eUV+o18et9ylNAdqYoh2YgK0aSNSEug X-Received: by 2002:a05:6402:3591:: with SMTP id y17mr1276145edc.67.1619064351155; Wed, 21 Apr 2021 21:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619064351; cv=none; d=google.com; s=arc-20160816; b=MTS0pckGWCAN+VFVIMz+WbWol+g+Wjvh0EXYaiJTOFAztQy6M68OPdzkPCxhr5OmC8 56pO/ipXFN9jh7KpRvsWLldfgFihRAY9zOsy6pAtw5oWHAp6CzB0YYKV/MgpxcYucqYi ha1QO/PEZ+P0+fUF45HTCFpzssC7zIDIsqWaD5mv09ah0AHiuvfAuHy2Jex6QmvyghTS AYaE1lYgs4C99Xe/bpptHxFZURoPGK7j1YaIFHNmmQyJ4RCohXpvU54Y1NZZu73UuFl/ F6dS6SlaNBYWmB2DbvVyRioRFJFz2tN+6ZN1mfpPV0d6u197Aad1VyfoxZbSQ7gbIYy1 Hcog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=VZAv9tLqrkVZOAHtRu1Ftpqpi6B5B4moHm680BDyXvw=; b=tRWQGoaC79G5BdRCm1UmrK/ThVlbhGvNfurUUhWRY/DVzPuz3Sp2cDudu6Lp5CP1AK NCARixZjjpeqj1zs5rcJdmZFiS+UdSVWJvOiNAElQnTpAkq1kmHHVfWUSSHKznPlyN6H nAlyak6W7k4rqsdVJYuH8TA3HS7eWh6Uh3fFeJmzgwG57v48BEYxmls1jFNQy4YOL8xi XYtuRQyzDR6JrDhkdhCBGLiRC2/vIqZe6Su0pjjaAO/pwosJfZJfo4emcX2x4JTMaQyS R2xAE57JCqJgj87GWimdbMiBiqY1Y79A3R0TXBpvlDL5jnRnoK5697xHgdil8lHhe3GO gzOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vKLbE6T5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si1244350edy.531.2021.04.21.21.05.27; Wed, 21 Apr 2021 21:05:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vKLbE6T5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229483AbhDVEEj (ORCPT + 99 others); Thu, 22 Apr 2021 00:04:39 -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