Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp764175ybs; Sun, 24 May 2020 21:14:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbmNwK+vI36Ek8XQH03DCcVy4e8scqhSveFUWPG1F1JYA9aCV++PV56H1bu6+JyQGQU/nc X-Received: by 2002:a17:906:9384:: with SMTP id l4mr16918043ejx.168.1590380080219; Sun, 24 May 2020 21:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590380080; cv=none; d=google.com; s=arc-20160816; b=08hbN4IgzfUjnLrzYiiXcbzGZSQq5y/yWGo/YlA+G05Q9jnM27MB5ty4FXQD4heIDY pInyNlw+xRmLb+mKM7//x4KK4hjJ4fhcyoVZa4LJQe1Z0bKXuJ4BuUcU9bnk2Svyf8pG 885kIDY9FcQ41gGiysEqgrz6RASpCNws4m1P1vDegcQlF7RcOupFu2RBWDjIbKgC8ug+ t+CpJCIofjTyk4VXElSOND6czwgpzJqsFYx6WBOW28aPWJUIt4fFh5N0h6RKZR+qlCTh dz/2bIxFl3s8e1iJgDEeMLLyVabAsIHoTkuOFsCIw5ZUXJriQXdeGvYYh8iyMBZNpsX8 JNPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=UspnucTwDyGphj6L/Hg9WIuFLpj1JQMENiRftHHV3jM=; b=o6nsI1uNx2MUsgHHBaKGMOWvPNGyumZfie4RfwB15aXSGXPhHfIKg1ksiyXue+HMsI XqD+56FOe65XYdp4P2bxq9MNXlbnW0XtT2YQ6Zw2uGFIs7bXKA/AoOarh4pxLSbufSir ThzEPlO/gNmOHUpCx8m5YOXuZiMwU3Si9hN4U3mQKU8XbsbLJJlxvOVCF2t4QWXlVK2i 4K267oBH2Dv2W87gN4ooJ924YzCjY9nBQra9hjY+GtILA90nleVXHLFyb62TUDuhnJYF 3qcYggZfom2T6gsneJ0twV/4vp20VB4rcQe2B+o0fKSi2+wINh5GzQS0zKGG/Xz1edCW cbGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UCAl+Oro; 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 oz18si8782315ejb.581.2020.05.24.21.14.17; Sun, 24 May 2020 21:14:40 -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=default header.b=UCAl+Oro; 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 S2388716AbgEYD44 (ORCPT + 99 others); Sun, 24 May 2020 23:56:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:60890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388463AbgEYD44 (ORCPT ); Sun, 24 May 2020 23:56:56 -0400 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B32EE2071A; Mon, 25 May 2020 03:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590379015; bh=pJXil/bjairFKHX1SnFfq5T+nsjaMXt+4tISg0dvTY0=; h=Date:From:To:Subject:References:In-Reply-To:From; b=UCAl+Oroosva071nrp8usT+/p6WVoQ/CuHuEjIKE0js6szr0kZhNuj8n+X/gSNSpx c4QjyzWg5jNvDeQdMjDmzZHw7QiayYFW5LWU9Y4glq+DIKWOYrtqUvknf/ydp3lbi8 gI/iz7T+75No97u50X+pDE9jSiiVbZICQH5gmoZ8= Date: Sun, 24 May 2020 20:56:55 -0700 From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Subject: Re: [PATCH v3] f2fs: avoid inifinite loop to wait for flushing node pages at cp_error Message-ID: <20200525035655.GA135148@google.com> References: <20200522144752.216197-1-jaegeuk@kernel.org> <20200522233243.GA94020@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200522233243.GA94020@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Shutdown test is somtimes hung, since it keeps trying to flush dirty node pages in an inifinite loop. Let's drop dirty pages at umount in that case. Signed-off-by: Jaegeuk Kim --- v3: - fix wrong unlock v2: - fix typos fs/f2fs/node.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index e632de10aedab..e0bb0f7e0506e 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1520,8 +1520,15 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted, trace_f2fs_writepage(page, NODE); - if (unlikely(f2fs_cp_error(sbi))) + 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; + } if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING))) goto redirty_out; -- 2.27.0.rc0.183.gde8f92d652-goog