Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp671982ybr; Fri, 22 May 2020 16:34:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwswoeedrevbMh9JVPWpKIVmZdWmXlu93Pc+XDB9cAXfi7zU5CYCI+BOEJ4POyroVWVFulo X-Received: by 2002:a17:906:3b4f:: with SMTP id h15mr9890170ejf.421.1590190480260; Fri, 22 May 2020 16:34:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590190480; cv=none; d=google.com; s=arc-20160816; b=AA41NsYYafhwbks1FSMES5Vvi9axqFOODQTNA6m+5FgGB9/kLOHE0gd1/yV1+PVhmp UnEdlBxvI9ajIw2CHX7PxI3Yuho1zCXOJGl5WrFyV4GLbN7fsNqeGZTdAW4Ga1gmE18T Qe0JDCY4WVdCi3bt+hjHdZKhkgW062tVf5RUObug2oJjz9rSnSx32EIxhYPB27pPZrRx Xhq3mdePWvUJegLOHw5t+PV2sNYy0aEv/e+At0KG9rNvldv/tKR9+DCgYB4e3HVDyuYb /zrQ3ORzhKjrSyF/SZPw9WyX3Rn45/sMHutUO40Bjo1m9fAROoqI8UDFYZWWTKNBT9SQ NPkg== 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=63aDiV7Zit+24aVtUA8K336Ropbqh2Bq1nxQYiy84FM=; b=X4EV2+4mnCDKNmgIv05jw/+rFYac8kAI62136Ub9gQ9sTHFP0qATvK4272bQxz0FuZ in5RhWOpb7iEo7lE7tiKXwOxZL4SOY200vYr/ZE/eG1UM6+Z3S0lWfYp553bGJ8A/7MF pYlHUb4tPLtFJ9okheQY3x5QXFYMS8tOQbYqUycFzQKjaYNKnTML7BGMBfxugtNCeOkf SrIFFkI17xOxdCxxdIS42h2bXBpF2ISnk08nTJXVwYMHzSFG0uEVW0Nd9men8tM2ReiZ DbQMukdvIJcVNM8ONwwAXZ9ib1zm+NzbQr6y9NgFu0yUoUltX6rGgEyNF5Qh/Z2Xno3u ZiUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UNVy7Q40; 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 e9si6304768ejk.708.2020.05.22.16.34.17; Fri, 22 May 2020 16:34: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=UNVy7Q40; 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 S1731238AbgEVXco (ORCPT + 99 others); Fri, 22 May 2020 19:32:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:44482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbgEVXco (ORCPT ); Fri, 22 May 2020 19:32:44 -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 E0C27206B6; Fri, 22 May 2020 23:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590190364; bh=u0mkeekhT7H4kvo0f/18YnuEmDkDZm6GrdqhYSj0Abw=; h=Date:From:To:Subject:References:In-Reply-To:From; b=UNVy7Q40ku/I6kDg1MJqnO4It3D0bR6jrRy2EglrTzAlteZEk13Lpsu6gfQPk1TEd lRH0mEEm5HbDZG16XTF+bCos8E4dPnWChBwjTJjuPikuJjFuTODB/Csya2pBOht59z M+WZyLayiKurgB1ZDN3Z5Y7oXlBJAaiUdf1hQ6Lg= Date: Fri, 22 May 2020 16:32:43 -0700 From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Subject: Re: [PATCH] f2fs: avoid inifinite loop to wait for flushing node pages at cp_error Message-ID: <20200522233243.GA94020@google.com> References: <20200522144752.216197-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200522144752.216197-1-jaegeuk@kernel.org> 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 --- 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..8c63964a82fd0 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)) { + dec_page_count(sbi, F2FS_DIRTY_NODES); + up_read(&sbi->node_write); + 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