From patchwork Sat Oct 22 07:19:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7631 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1107513wrr; Sat, 22 Oct 2022 01:41:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wgHLnhMTXgpUUvz9iOOuBiQFzc/cTaKmH1xRP5L1GWu18gVhPvxh9aH6KMWyJuXF5ufyB X-Received: by 2002:a17:906:cc5c:b0:7a0:a52:8c05 with SMTP id mm28-20020a170906cc5c00b007a00a528c05mr2731740ejb.686.1666428067960; Sat, 22 Oct 2022 01:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428067; cv=none; d=google.com; s=arc-20160816; b=YBX+P2lt44fc4/cqL7CXLGy5tdPJg7qxq8ixPt7DYEyF/K/P0u4XR0RO4F44GJaBf/ XIPgdqAn1Ls5quqkIUsJMos7W8/1qw8O9IX3GqbPSwmJd4U4fTZOCLHpw+FhJx5yu6qq MqjTe12TTLCAXX0axL31xyfcpyz+MeFo4yvZiJrmsZZA5SM+SwE3+YxywstpPh3sOB/O 6PWpCMFSiY9h3cxbx9Yw9Ku6VQtXeh3t1wsfaeWQdJD4peM+hGK4ojpa4W38htl0Ahe7 hqv6r6YhjkpgonwkQSSoq2OsIR8rA6cm6kYDYi3w7zta9TBLCaVAO5rvwPpRp5PqsuGo jaAA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DX3U+c259M7FwvA56ZM842lsr9RQWobeOcEvJ6E9bFc=; b=cZ3m3JEr6fqkz+cImN4rlJPgEaAUC3QFfdAZViJpJe9C8J7MVaj7gwCPXX5jWFOuGj SnQqIYT3YKCS3fMCADCrhVbXi7OgBImNX2LrUYo3SOMcBBCOjetVYV1IMYFDs53JKjP8 BJ7CIarDbpVZ50aouL5WTLyZUw1LHKjd2G53XGWV4xwNq+5SfFvkndWJ4jj5nxnYxjWs P7mHJGvWcp9m4v++HUSckSCGfRXELxkPA5XUPV49F+OS+Ksn1NJudMMdfz+kL1B3MFpY w5k+xPirOaQFyr/3JNICzrvOpe9ZS5XAUMFWCm6qaS4f3r7DTrmJm7ixu+xiUhQsZMnL q8hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K4rgI4k7; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q6-20020a1709064cc600b0078fcfc5d24esi14875675ejt.618.2022.10.22.01.40.38; Sat, 22 Oct 2022 01:41:07 -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=@linuxfoundation.org header.s=korg header.b=K4rgI4k7; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234065AbiJVIiL (ORCPT + 99 others); Sat, 22 Oct 2022 04:38:11 -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 X-Spam-Status: No, score=-7.3 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376477751667304?= X-GMAIL-MSGID: =?utf-8?q?1747376477751667304?= 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 == 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 = false; - spin_unlock(&sbi->gc_urgent_high_lock); - sbi->gc_mode = GC_NORMAL; - continue; - } - sbi->gc_urgent_high_remaining--; + if (sbi->gc_urgent_high_limited && + !sbi->gc_urgent_high_remaining--) { + sbi->gc_urgent_high_limited = false; + sbi->gc_mode = GC_NORMAL; } spin_unlock(&sbi->gc_urgent_high_lock); }