Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5868882pxv; Wed, 7 Jul 2021 13:43:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPAkPm2ewScPp7KuqlZ2X/nt0OhDLDyu64dxd9XOvpLtPgeCtCYqlKzdpmySC3pRMEiS+y X-Received: by 2002:a5d:88c4:: with SMTP id i4mr21745476iol.210.1625690611598; Wed, 07 Jul 2021 13:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625690611; cv=none; d=google.com; s=arc-20160816; b=oeQZxnbYep6AsFGqMpgcBXhdoyNaITCIpqCa7np/awkHcB/2T/OYItHTCZY41sSvaL tJVXEYVomSZ+7cT+qM/PWkj22DHaNdWoy5aIXGIh5L87nlrtCIoR6qouu79EyB8n70KK 4D2EmDuAYqudbKgjRtWwWENuu87dscU2/I62BhwSSejQBIDZZwFr16K5Q176hIt0T49L OKyG8EBEo6e+4GBghyEwol1YwQkM7B9soGf0Dxh4rRernS+JgE0v1F2MHHEBP5KJXIna gWIZN3Kfh47dciyXdKt8t9MDQzAFp7feNQzLa4g4R+QYZsqskaG3izdEcz69SEkgJ5yn JyZQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=2e2vI8OFotAHRwxQhsUAwsU31NWnSuHyIiqH5UHX7nQ=; b=zhG+Rzd8VkTlMT1FKYHgkKlHSy8DIH2hc8AVtf5Kd1epZbMz4kQXPc/LyhfIg1geB7 giagRlMxlnnzr5c0VvTazCAiJfxT7r+/XETStb7Na2cLMnbn6ks4zTZj3lDASMp9xQvJ NAY8zhw0Ou2KRn22lG9ofT3z80w4f/uQFsKfdc2Q4wyMK9meKp0kF0qU/hshdySxjwyK nH7dC+jS2BE4RAvKBdXY4t+Gznq8V71R0O4drlgXsEpN1DnCCvHM/7oBTTYai0I9Gj1j ptP8KFKFYXezzW8W+8hShSyNYgqCBG+uYP/RAudmIOUoxzu7B8fjUwGozBbbUAAny0VJ onZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jW49LuE5; 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 t3si125317ile.109.2021.07.07.13.43.16; Wed, 07 Jul 2021 13:43:31 -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=jW49LuE5; 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 S231804AbhGGTdd (ORCPT + 99 others); Wed, 7 Jul 2021 15:33:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:33292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbhGGTdc (ORCPT ); Wed, 7 Jul 2021 15:33:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 08D8661C6D; Wed, 7 Jul 2021 19:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625686252; bh=3pODlJmfBdRZUct1Nd+7/oWJuLC7tASVT2444KEehJA=; h=From:To:Cc:Subject:Date:From; b=jW49LuE5IDef38qMg2fJPfUyoUapV9yA8K76i0BmqMaLxTujkLYshGo++CxDhuC1s TlOoxvFV+rXcX2AzlaAxUdPOPQCmMDyuQNiPPp9qG9rkULA/X7jk7QTPX7tA9N7waN Oh6uBao8oal91hfx+oEeMxPzQgL4bzaygVH/fVCkwc3iNGAU8w15Qo+EfOqWMCTEZP UKitmWIhbisTePb64ayH4DAkW7MI5vKDwjkbSZP9YmpgvoxhBsnjQPOlixzkPcdI4q 11kWrpEY72K4q3j35hCPxFwNKrp2t2TdmEZOfmMchAJul7mat+C1VCNI1FIWakaMDe X9TrtiXqvCzXA== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: drop dirty node pages when cp is in error status Date: Wed, 7 Jul 2021 12:30:43 -0700 Message-Id: <20210707193043.969238-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Otherwise, writeback is going to fall in a loop to flush dirty inode forever before getting SBI_CLOSING. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index dd611efa8aa4..0be9e2d7120e 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1549,13 +1549,10 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted, trace_f2fs_writepage(page, NODE); if (unlikely(f2fs_cp_error(sbi))) { - if (is_sbi_flag_set(sbi, SBI_IS_CLOSE)) { - ClearPageUptodate(page); - dec_page_count(sbi, F2FS_DIRTY_NODES); - unlock_page(page); - return 0; - } - goto redirty_out; + ClearPageUptodate(page); + dec_page_count(sbi, F2FS_DIRTY_NODES); + unlock_page(page); + return 0; } if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING))) -- 2.32.0.93.g670b81a890-goog