Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1144904ybs; Mon, 25 May 2020 08:10:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTTZYaow0g1+CC6HiI0iV92shB0ftKU4G3TBcbvRu2BzAYJNTGSkZ6CNBdfNkz/+fYSqFj X-Received: by 2002:a17:906:3041:: with SMTP id d1mr19686179ejd.7.1590419446051; Mon, 25 May 2020 08:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590419446; cv=none; d=google.com; s=arc-20160816; b=zo0jFwwifCs7PHpkhF9uwhQ2wz+iefsO+WebRvPhfgD7of3OaIT83jODy9tzzEuxpx jgFIwRT/A3rn/kq/eVh1ZqPzL9Gfa+yTgBqKpHGnicz1a1ygxW1xFL74zQwyNDjWCYup 9nffQjAdnkMndjfsMMmd/F/Zp3X+VwAlKWCy6smghp/n1fE3YjNugw/ykk88O0f6tWDM SOMyykhBDDVTtnL0dTxCY4kvhmSaLf0/0EODYlpbWo5TONYC1A9fnJ1E+9miA0/Z1GpW nNHJjEC5McBduF9r4m762YBOdjeMgmUfbFbypvV59OAw4D4WnjxYyRt4svZrmCNUWVM4 mvYw== 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:cc:to:from:date :dkim-signature; bh=fLvqJrwq087yxdBpeo9/hmrXcl+Urs7GboudNQy6C6E=; b=LDWFVTxkZtSXPfRDHfF5l3zH4zgy8B9X+uHI7QPMNTFcBmCXfif3mil8Xx4KuypMys 6aXlOq5aiRh5qT2rYIsn4DOoOBhauesnJmlBzbJVP3XKmxAFvNNXGjP7fLxekZQlLGrb B/xlQg909qwyLDnE3woNPXdnTK7o+32G4v7ZnsbAvrNHk6W7bewKRVWXxjTJ6S79PAby pOjPOLlXBQmKbFyZ80UaZYunagFqBzN6dlR7CyFYzV7wJ2W7Zc1fAW99x6YZIGgf6ETp UjW56ihuH6kdtIxY6s+wNtExQDQnoQ6qMeYIQ+qKQEMCN25w8s3TCHWJt39Bci7WyHsE iMFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jlK20N5I; 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 b25si12305325edn.602.2020.05.25.08.10.22; Mon, 25 May 2020 08:10:46 -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=jlK20N5I; 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 S2404064AbgEYPGJ (ORCPT + 99 others); Mon, 25 May 2020 11:06:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:46402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403996AbgEYPGJ (ORCPT ); Mon, 25 May 2020 11:06:09 -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 B334C2073B; Mon, 25 May 2020 15:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590419168; bh=4SC2F/J4NM6UzddDGe9P2eGlKLN/Z3dzLHep/jr+Cg0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jlK20N5IGG1yq/mL5w9FNBnsglQEBvK/wPUtLGakC+fhSReBtCHjU0u23i3kQRBxB yhm0qwTkD0TvHHE7w6RgTvc/dbHJZ8EIzx5PftivOe9DWBbQr2O1GdeCzh3gyWtCiW 3ClhhR8uygFFtIFwoRCm4hOyj4RSgmuvkokxr/rw= Date: Mon, 25 May 2020 08:06:08 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Subject: Re: [f2fs-dev] [PATCH v3] f2fs: avoid inifinite loop to wait for flushing node pages at cp_error Message-ID: <20200525150608.GA55033@google.com> References: <20200522144752.216197-1-jaegeuk@kernel.org> <20200522233243.GA94020@google.com> <20200525035655.GA135148@google.com> <565af47c-8364-d910-8d1c-93645c12e660@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <565af47c-8364-d910-8d1c-93645c12e660@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/25, Chao Yu wrote: > 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... I believe we're doing for them. :P > > 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; > >