Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1085715iob; Wed, 4 May 2022 14:23:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwj1eW6ZQjA6fr7PHnp4afT5I2Mge1nDeZAhQ0nBJHHk0N397psRh1lWdvtPKTxD9xdQFq X-Received: by 2002:a17:906:7d83:b0:6ce:fee:9256 with SMTP id v3-20020a1709067d8300b006ce0fee9256mr22688165ejo.647.1651699415989; Wed, 04 May 2022 14:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651699415; cv=none; d=google.com; s=arc-20160816; b=XTGjEe0h/9+Z74fcO/CT8itiFAldoYXKjZ2nt9GrTON0Nb9EAQ0H1imhiUCO8KbNrC 0EztA3iPm39UZDo8hgv56Fzmh4jfZnai5cMxbSdmu77JgQex3miiSUdbU1RqXLHIevri UHjyGKyOZw6xNt7rqYMBPfVYCPGbhfPcyo7Tto6ENIHDNGWHfkET2HqQyJSh9myU146n 2M8mm6QQZYLeajIlX1CKiUj9TbgUXbaBoIwBZ4pXe7Y2OKVeW4lGFqHp+Pr4ykSsMNZQ FgpXd9mLFwwg2bYXIWon/dzMb215CSU10g56K0jdEAkgcJ8U9rVBR4o79pPKtFRK2EG9 dm2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W89bP8vTvWbz0PYbkvAq4B5s9mtHoGvI3M1NbfgHrpc=; b=DfE0pyELA3DaIwdKcl4xjS95Z+Ii3QdxpUaNbUJrVVxZxJXBgyauHp5tkgvR/r0grm ksvCITHAkTiNrOxGF6ixMDa+XcTOJKfkLCV83M4qjbLkXgycTGJRKBdvW8G/gPqIuCPz YthZL+sH/nrnqiXP4SUg/fLFPwrUvIb75aXIUXyiWo+i2CF5DsLsj9WjQsqH1jvGlRiQ cnYX1P/HfZcqm5jfmE0VxuDvrYrzt2N+Y4ZbJ7/dCe8JmIOL6BKWtfyDHVlwP7BNZM+G Hc8vpWVGeQBViTdlAyH95JbEPXqhHv2tkxXALqadCgExDnC0ncZwqu5Yy/umzeOs2he5 uG+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fEYQfHh8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a056402520100b004261fc20604si2348187edd.460.2022.05.04.14.23.12; Wed, 04 May 2022 14:23:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fEYQfHh8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S237121AbiECUeU (ORCPT + 99 others); Tue, 3 May 2022 16:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232927AbiECUeT (ORCPT ); Tue, 3 May 2022 16:34:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2644920F78 for ; Tue, 3 May 2022 13:30:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A2F0160FD6 for ; Tue, 3 May 2022 20:30:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3540C385B1; Tue, 3 May 2022 20:30:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651609844; bh=mVOGOpBYm+Bzhe/7VV0Fmk4EZbmIIpgNhl6/C1CkJlo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fEYQfHh8q/fYnUgf6snM5cXsjOCXkcs50x7ugGNUOG0SaivZSJgrAHBGPF+CyO6wM D0+W6cAwprtt8rExly4zdSAKRu5xSgZf6awUjKJlXPmCRMg+FfeDTmibtWqjnajGnM eqtj4GLrLSGDqGaQDr8ZbOBnOHOPJWDi1GU3Ku97qG+Revw7GNwxEZD1TdGTd0IikF 4Lyx+/srcisy9Zp83jt6t1vWhHKpGmlC/9nCrcIUnpemqo5yCetFu85O3Mg182pAsY M01K0wth2JG8uAaQBQi5yJ0e52dTkSCgL6BWUoYriNUqu3HJ1HE8vwfH3f8K5gJyyk cDrPM3qieTqxg== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 2/2] f2fs: avoid to select pinned section during checkpoint=disable Date: Tue, 3 May 2022 13:30:40 -0700 Message-Id: <20220503203040.365028-2-jaegeuk@kernel.org> X-Mailer: git-send-email 2.36.0.464.gb9c8b46e94-goog In-Reply-To: <20220503203040.365028-1-jaegeuk@kernel.org> References: <20220503203040.365028-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The f2fs_gc uses a bitmap to indicate pinned sections, but when disabling chckpoint, we call f2fs_gc() with NULL_SEGNO which selects the same dirty segment as a victim all the time, resulting in checkpoint=disable failure. Let's pick another one, if we fail to collect it. Signed-off-by: Jaegeuk Kim --- fs/f2fs/gc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 4d47723523c3..5ba8104e138b 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1838,10 +1838,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, if (gc_type == FG_GC) sbi->cur_victim_sec = NULL_SEGNO; - if (sync) - goto stop; - - if (!has_not_enough_free_secs(sbi, sec_freed, 0)) + if (!has_not_enough_free_secs(sbi, sec_freed, 0) && seg_freed) goto stop; if (skipped_round <= MAX_SKIP_GC_COUNT || skipped_round * 2 < round) { -- 2.36.0.464.gb9c8b46e94-goog