From nobody Fri Dec 19 20:33:54 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF569C433FE for ; Sat, 22 Oct 2022 08:38:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234434AbiJVIiM (ORCPT ); Sat, 22 Oct 2022 04:38:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234048AbiJVIc3 (ORCPT ); Sat, 22 Oct 2022 04:32:29 -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 6D6332D12A5; Sat, 22 Oct 2022 01:03:34 -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 550C260B23; Sat, 22 Oct 2022 07:39:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 626E4C433D7; Sat, 22 Oct 2022 07:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424345; bh=KzHqx2mfIHoyi1WiueYBo5GyvE9Q9Y8B+TZngBTNrwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K4rgI4k7gh2A3Sbwh5MYDQGzhlYplNKetmTJCE0dUsdd0NlXhWt2hOleKEsNUHZ75 nyvvPRnc405rkpgYb1C202HUbTk4es8+nlyvu0HOWXlaPYGmwQIAet9T9HjuuGRhZN X2OpG+jPXezb2SoGBB9C2KuaDTEGEeIQAgd7rQuM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chao Yu , Jaegeuk Kim Subject: [PATCH 5.19 112/717] f2fs: fix wrong continue condition in GC Date: Sat, 22 Oct 2022 09:19:51 +0200 Message-Id: <20221022072435.271034123@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jaegeuk Kim commit 605b0a778aa2599aa902ae639b8e9937c74b869b upstream. We should decrease the frozen counter. Cc: stable@vger.kernel.org Fixes: 325163e9892b ("f2fs: add gc_urgent_high_remaining sysfs node") Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/gc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -97,14 +97,10 @@ static int gc_thread_func(void *data) */ if (sbi->gc_mode =3D=3D GC_URGENT_HIGH) { spin_lock(&sbi->gc_urgent_high_lock); - if (sbi->gc_urgent_high_limited) { - if (!sbi->gc_urgent_high_remaining) { - sbi->gc_urgent_high_limited =3D false; - spin_unlock(&sbi->gc_urgent_high_lock); - sbi->gc_mode =3D GC_NORMAL; - continue; - } - sbi->gc_urgent_high_remaining--; + if (sbi->gc_urgent_high_limited && + !sbi->gc_urgent_high_remaining--) { + sbi->gc_urgent_high_limited =3D false; + sbi->gc_mode =3D GC_NORMAL; } spin_unlock(&sbi->gc_urgent_high_lock); }