Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp873352ybs; Mon, 25 May 2020 01:03:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyr6kcgP/VpatLt+xcFYR3MVCbIH1xtrdbB2qndP9soCYtyi1uxN2qTuWnYqioO1QXPtYyI X-Received: by 2002:a50:8707:: with SMTP id i7mr6241456edb.180.1590393812080; Mon, 25 May 2020 01:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590393812; cv=none; d=google.com; s=arc-20160816; b=tn9pf3VhnQeG2BD8r9ZRemK/6Fxnu1LDXUBtZhhQwIbw7nLKi28jk67dfd5Tx3TzpG +GmghBaKPFgj/qGr73A5eBJedtglHpjomOr6ptmgeNYPzyxdWpuK7RpJj8CTqV41ESwB iPOcusgoWjxpDx9939agPb1+HJQxPTJ9zXIeKxYq8i3VS7t3hO4lOhemmTwdDxtOqEO9 3at7cvJekdHMcmFaZTWePfl8SdNfSL6EEGRsmbTcnkMmJanfI8Bhh/jIHUgV/nPfgs4r v9uAMz+d+4qDXoo5mosnoTPBffsar1ZKCTP39QewUHlWyQnROkTagDm9yUPidNXPkhlX Sm6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=yBVGOqYruxLU0N+R1JGn/cnBLGv91eFKNiyMFQp9nD0=; b=y8BUg724aIZ+6yaqTs1uFuQ8IeYl25j731vtpyAyjRzL+HB+cX/cNzGklOUTanYjGj XY3Li0rSaPl0albwklR3MDVxqs7yV8UoIpvs9GzC6tLEeqV8OBebyR8BBoC9NumuTB7k tIFUnyfxhaqPJbNduJoERwk95i6MOSIyIHbdG1tiAKlBDvETr1ZQffkB6+1i7kG6B0So /eKAWvyFjdroyaxQfqi9l/kDv2/mAeb5jAZOQdnPgtKruIiwom4Io/R2oqbMPUCu4ujF pSE4YXg5PzqWuHQm+alLBoJ/CnxOMlnf00aHVt0wr0tR/HlXP6LYw9MjJUtnwuNMfoY5 n9qw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si12015695edi.579.2020.05.25.01.03.09; Mon, 25 May 2020 01:03:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388891AbgEYGak (ORCPT + 99 others); Mon, 25 May 2020 02:30:40 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:44998 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388631AbgEYGaj (ORCPT ); Mon, 25 May 2020 02:30:39 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0D714C6D2510EF809AD4; Mon, 25 May 2020 14:30:27 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.201) with Microsoft SMTP Server (TLS) id 14.3.487.0; Mon, 25 May 2020 14:30:26 +0800 Subject: Re: [f2fs-dev] [PATCH v3] f2fs: avoid inifinite loop to wait for flushing node pages at cp_error To: Jaegeuk Kim , , , References: <20200522144752.216197-1-jaegeuk@kernel.org> <20200522233243.GA94020@google.com> <20200525035655.GA135148@google.com> From: Chao Yu Message-ID: <565af47c-8364-d910-8d1c-93645c12e660@huawei.com> Date: Mon, 25 May 2020 14:30:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200525035655.GA135148@google.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/5/25 11:56, Jaegeuk Kim wrote: > Shutdown test is somtimes hung, since it keeps trying to flush dirty node pages IMO, for umount case, we should drop dirty reference and dirty pages on meta/data pages like we change for node pages to avoid potential dead loop... Thanks, > 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; >