From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61C33CA9EA9 for ; Fri, 18 Oct 2019 22:17:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D37922475 for ; Fri, 18 Oct 2019 22:17:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571437022; bh=WHX65/AoIFRyii84i/q6+u2Bw9cdOY7501KBf1Lu+rQ=; h=From:To:Cc:Subject:Date:List-ID:From; b=wi9KMkGjUxRvhfyP3DzsI4COBdiXgx/TDNVigvTcYrbanXxax+VULZX77Pkn51v2R Uf92nW7HZUNIRFpmgYGgNfI3UlSAo6xs5GOWDr8tZ/malIo51JFWFeip6IxW+Wle1Z exWPgCoTU+f3tHJ3nXJzezG52Xjl+bh9dazDJe7s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393236AbfJRWRB (ORCPT ); Fri, 18 Oct 2019 18:17:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:40322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387418AbfJRWHz (ORCPT ); Fri, 18 Oct 2019 18:07:55 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6AE12205F4; Fri, 18 Oct 2019 22:07:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571436475; bh=WHX65/AoIFRyii84i/q6+u2Bw9cdOY7501KBf1Lu+rQ=; h=From:To:Cc:Subject:Date:From; b=aRVyiRteedN3fziJZ/CIECe9t3VOs3k8b9v0TxGLG4Q5cDI0MC8+0z9AFNFZMAF2N owZGaTkf+pG97RnBVJNh4Crzzf21LVGD58imoMF9Gpvguv6Xbkae+Y5MrF0/NcBZmH 2HsRF9cxCN9F0m8s5rOJNdPTOlaO8uWyT2p3moi0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jaegeuk Kim , Chao Yu , Sasha Levin , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH AUTOSEL 4.14 01/56] f2fs: flush quota blocks after turnning it off Date: Fri, 18 Oct 2019 18:06:58 -0400 Message-Id: <20191018220753.10002-1-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jaegeuk Kim [ Upstream commit 0e0667b625cf64243df83171bff61f9d350b9ca5 ] After quota_off, we'll get some dirty blocks. If put_super don't have a chance to flush them by checkpoint, it causes NULL pointer exception in end_io after iput(node_inode). (e.g., by checkpoint=disable) Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 344aa861774bd..1ff0659d53d01 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1523,6 +1523,12 @@ void f2fs_quota_off_umount(struct super_block *sb) set_sbi_flag(F2FS_SB(sb), SBI_NEED_FSCK); } } + /* + * In case of checkpoint=disable, we must flush quota blocks. + * This can cause NULL exception for node_inode in end_io, since + * put_super already dropped it. + */ + sync_filesystem(sb); } int f2fs_get_projid(struct inode *inode, kprojid_t *projid) -- 2.20.1