From patchwork Thu Feb 16 07:13:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggil Song X-Patchwork-Id: 13142673 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26D92C61DA4 for ; Thu, 16 Feb 2023 07:14:18 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pSYTB-0001tI-Vm; Thu, 16 Feb 2023 07:14:17 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pSYT5-0001tB-Ev for linux-f2fs-devel@lists.sourceforge.net; Thu, 16 Feb 2023 07:14:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:Content-Type:Content-Transfer-Encoding: Date:Message-ID:CC:To:From:Sender:Reply-To:Subject:Mime-Version:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/s/DDvoDqvkI0R3gCjxwHuxsXwGnIrRYiSsKEv400/g=; b=d+eplgnfu7unzEXPVzblSHCIWf NvacIFtMG5xBfwJ6IjtdIIuDBPK30XUCPxNjgqx4nv5kz/0Ve4n0nSEl4pi2MjQV3kd00c7AsRL9H xl06dOVFblbBvKJ2SxPTcOnA9SHGxTbNoe/92CjRPky7GWTIaxH+fblYSRfrFL39D13s=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:Content-Type:Content-Transfer-Encoding:Date:Message-ID:CC:To: From:Sender:Reply-To:Subject:Mime-Version:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=/s/DDvoDqvkI0R3gCjxwHuxsXwGnIrRYiSsKEv400/g=; b=O nXKdsq87h2OZPh4tKopWsep0WJZEPyAPDxbi8zNuUIpzVbYj8XWMnT+RSEG3r9VLtyalThzBHLcJC UVdG45wP8awTUgSiW/El0JVKgtri9sa7IDEHk7WrAlvli9ZKJo1K4ZaNIVu0f3dvyZ1U1f5v+Zvaj PvuHofV+Sel7nPR0=; Received: from mailout3.samsung.com ([203.254.224.33]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pSYSu-0000mM-F0 for linux-f2fs-devel@lists.sourceforge.net; Thu, 16 Feb 2023 07:14:06 +0000 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20230216071351epoutp038e9f7258120cfad7aa4b3bb74563cf89~EPKLWoHe52971629716epoutp03m for ; Thu, 16 Feb 2023 07:13:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20230216071351epoutp038e9f7258120cfad7aa4b3bb74563cf89~EPKLWoHe52971629716epoutp03m DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1676531631; bh=/s/DDvoDqvkI0R3gCjxwHuxsXwGnIrRYiSsKEv400/g=; h=Subject:Reply-To:From:To:CC:Date:References:From; b=FhlJk2fQEkFwbFsZXf/SP5bxhpxj20U0tOp1zytWzChCqAhZxfJ5atiN3bjDK6NWx O+ZR1Ekz3C72i4AOihqi2VENhHkxY7p26T76yFZ9E9dSr9J8iN+hTaYbGVlGM9L6/o pBzO891OAl0/xhFWqUO8ns39kyUlurlcXX0IrFk4= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20230216071351epcas2p1e45a30e991e440d87e949dd5415eb736~EPKLCWZSp2317123171epcas2p1W; Thu, 16 Feb 2023 07:13:51 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.101]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4PHR4t4fYMz4x9Pv; Thu, 16 Feb 2023 07:13:50 +0000 (GMT) X-AuditID: b6c32a46-4e1ff70000007a4b-c9-63edd7ae7059 Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id A1.79.31307.EA7DDE36; Thu, 16 Feb 2023 16:13:50 +0900 (KST) Mime-Version: 1.0 From: Yonggil Song To: Chao Yu , "jaegeuk@kernel.org" , "linux-f2fs-devel@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" , "daehojeong@google.com" X-Priority: 3 X-Content-Kind-Code: NORMAL X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20230216071350epcms2p7b3f5f37b168b634ec7a7ba8555fd0b49@epcms2p7> Date: Thu, 16 Feb 2023 16:13:50 +0900 X-CMS-MailID: 20230216071350epcms2p7b3f5f37b168b634ec7a7ba8555fd0b49 X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPKsWRmVeSWpSXmKPExsWy7bCmqe6662+TDV4tk7c4PfUsk8XU9r2M FqsehFs8WT+L2eLSIneLy7vmsFms6pjL6MDusWBTqcemVZ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m2sERtpcL/4QmOy9dNVOJpTgj 0VCLuag4EQCs9AkAEgQAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230215024850epcms2p22be2cc864d82b44f31c19a7ef28770b6 References: X-Headers-End: 1pSYSu-0000mM-F0 Subject: [f2fs-dev] [PATCH v2] f2fs: fix uninitialized skipped_gc_rwsem X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: yonggil.song@samsung.com Cc: Seokhwan Kim Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net When f2fs skipped a gc round during victim migration, there was a bug which would skip all upcoming gc rounds unconditionally because skipped_gc_rwsem was not initialized. It fixes the bug by correctly initializing the skipped_gc_rwsem inside the gc loop. Fixes: 3db1de0e582c ("f2fs: change the current atomic write way") Signed-off-by: Yonggil Song Reviewed-by: Chao Yu diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index b22f49a6f128..81d326abaac1 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1786,8 +1786,8 @@ int f2fs_gc(struct f2fs_sb_info *sbi, struct f2fs_gc_control *gc_control) prefree_segments(sbi)); cpc.reason = __get_cp_reason(sbi); - sbi->skipped_gc_rwsem = 0; gc_more: + sbi->skipped_gc_rwsem = 0; if (unlikely(!(sbi->sb->s_flags & SB_ACTIVE))) { ret = -EINVAL; goto stop;