Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp336865ybr; Fri, 22 May 2020 07:49:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPAZiY0RJvs+zqe2I3UWU8eVgtikEibWvBVDqb3dZAGMkut5QbQg9f7KKoNQ2Py6Y1zsGg X-Received: by 2002:a17:906:70d:: with SMTP id y13mr8029369ejb.99.1590158995435; Fri, 22 May 2020 07:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590158995; cv=none; d=google.com; s=arc-20160816; b=I78X1XINLuca3SJyVkSJhmCL5yi0CrJIkdFPHAJVk3BzI61sdblZ+dpeh+gjUL9vrC 3Smbyl8VPc1VT9SgQAUhR67YESh9TXuKLtu56oiNgJ49y4gjNWxGs/bIP9iGot2Zjdgm P3F/LJWAKZxZvoGDcKywzxCKDH9df+IxZXwmeoaa/PRCrsnJaWvnWJXZAcy1xBEIsOcB iwhFiYjBI6mRRHc9/Bcw/qCRNowsWPJwzBOkEW8d4dlmln7DPzzR0t2mpIGl+noF5MtV aymkeMdD/NPAwA8rTfiz/LJmcv3yGjAZarqzBpTOT5S8tkvLU7ZaiBMXi0ZzZ4nksa7Z nPFA== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sMYeY6WdCbOjzOKq4ihA0mm0B4CKru5v8uH3S76/lfk=; b=jGknOMYS9hptlDTGD0jBccVXnWGTgQeStE6KIjKmelQVgAuh0LcvWB6DHPfgL2YRfx VM88NuZ6tHau/t2CL3T5vQIltgr1lIjdgGpQQJXmBN+bprKAFM8itr1LgEzepjSmM96u Ayz2Y1uGKEgfW28ZE9BY+jzxjg9Gn+WIoc72iIX7kvg6b2Grfqfc4+E5FXpFJqTPa1z6 zrjELCw8hnKw7a1GdLDiWpOJKLENFik3VBbbAOkKqqYkaAC9fQUsJQRnF8wWe25sxgH0 /94we9DpPLNMFdufpU/ig88s1TTSxsygNG1hYOSljFGgFgGifsyWoJN3NmcNPZCnBfBw 1ZUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="iAs/omKs"; 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 j5si4545781edr.589.2020.05.22.07.49.30; Fri, 22 May 2020 07:49:55 -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="iAs/omKs"; 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 S1730149AbgEVOry (ORCPT + 99 others); Fri, 22 May 2020 10:47:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:49886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729903AbgEVOrx (ORCPT ); Fri, 22 May 2020 10:47:53 -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 4BF072053B; Fri, 22 May 2020 14:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590158873; bh=raIADVb+UkJizyoPCsxQYw2PqWtp3N/rKlscrbRCbvA=; h=From:To:Cc:Subject:Date:From; b=iAs/omKsTX5z+jiiD65a/OkLhPepFhPVXOx2g9S8IzcljenaPbcmpjB8cIfulkdSm EbBPQtg2cSC5B+rdA56mJgRkjrf3f+Fb4szcJjwV5gyKuEz+9g87jgcWHaInrf70cc q6RfPSavSO+bQgoELw3dQI9T8ZAu+e8dUj5JgmrE= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Jaegeuk Kim Subject: [PATCH] f2fs: avoid inifinite loop to wait for flushing node pages at cp_error Date: Fri, 22 May 2020 07:47:52 -0700 Message-Id: <20200522144752.216197-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); + 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