Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp738520ybs; Sun, 24 May 2020 20:15:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL0Gc6s6Q/CkNonfqMmciHEKoRsxG3+17n89ylWwY01RKu/kp9HyLAGdY4U5HSASP7w29s X-Received: by 2002:a17:906:dc2:: with SMTP id p2mr17126739eji.212.1590376513607; Sun, 24 May 2020 20:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590376513; cv=none; d=google.com; s=arc-20160816; b=P+vGB/wb/mY37wz9dOKp07MbLdERmrbY7DXdII3z1MyoeVHT/I/KVHcnT/OCuGhT4o HK21b7vlLmd9/7HHQ4HOpVKsYgq1mwSBDPfRNH1bKF4BC1WGpFPU7TsJ/SW4ZM9RaI44 aNGKe+en+21pAss68KeMM7+rRb7rd6/OsK3+tRegFPIjDSoL6WTsnRwIagFtYzxpybHR hMIPrAnwYs0PXOAa8bIpJFapkzOrP0kd7AwGtFKJkUf8tVraK+lDoz0YpvF1OywjMbAc 3WPDRdd0VirxPpJXDkUmUlYhv35hf5PwjsWFCw/depe6nsu8Nx/3it6FK/GMvuAgPTF5 xsAg== 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=5u+CNccuFfcRKkkJY3YDWACIc/wIIH5rwHE1ugHkJxc=; b=1DKPlHvDHDcpZnrL9o2G+ep+/j9NznIFdomHsW1fjJB48ae6+pWnqotAgUpR5sjfpf ZtBiqlu+ObPk3CggTRjPbDdJ+AfR5IHQOZWlsMkMU2xkKUo9/7ZgHe5kK/QOP3h6C5xJ brdP2/JBjJ6zQENNyDgtXnFlqYbpJlZ2Ul9YupQWC0/GPzPWVopyq5j4yx1sDcWYCM14 xPruHAHLInBXAF5V6m0TpDUBb+1O/MrAa6KXNd8ymKFbvvriHPXT2BjcypJXeWh0VaPE y8gTvjeRFInuEdQM7C2mS7TkF5PhBDCCfy2NveDe/3eaYeRBiib82+sCh0HKI+o614ON eCMQ== 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 se12si9376510ejb.86.2020.05.24.20.14.51; Sun, 24 May 2020 20:15:13 -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 S2388666AbgEYCRB (ORCPT + 99 others); Sun, 24 May 2020 22:17:01 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:43784 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388425AbgEYCRB (ORCPT ); Sun, 24 May 2020 22:17:01 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E161DA2192EA7979E763; Mon, 25 May 2020 10:16:58 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.207) with Microsoft SMTP Server (TLS) id 14.3.487.0; Mon, 25 May 2020 10:16:55 +0800 Subject: Re: [f2fs-dev] [PATCH] f2fs: avoid inifinite loop to wait for flushing node pages at cp_error To: Jaegeuk Kim , , , References: <20200522144752.216197-1-jaegeuk@kernel.org> From: Chao Yu Message-ID: Date: Mon, 25 May 2020 10:16:54 +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: <20200522144752.216197-1-jaegeuk@kernel.org> 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/22 22:47, Jaegeuk Kim wrote: > Shutdown test is somtime hung, since dirty node pages weren't flushed out. > Let's drop dirty pages at umount after shutdown. > > Signed-off-by: Jaegeuk Kim > --- > 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); We don't need to release node_write lock. > + unlock_page(page); > + return 0; > + } > goto redirty_out; > + } > > if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING))) > goto redirty_out; >