f2fs: flush quota blocks after turnning it off
authorJaegeuk Kim <jaegeuk@kernel.org>
Mon, 28 Jan 2019 01:59:53 +0000 (17:59 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 16 Feb 2019 04:59:45 +0000 (20:59 -0800)
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 <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index 5e1f857..7694cb3 100644 (file)
@@ -2026,6 +2026,12 @@ void f2fs_quota_off_umount(struct super_block *sb)
                        set_sbi_flag(F2FS_SB(sb), SBI_QUOTA_NEED_REPAIR);
                }
        }
+       /*
+        * 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);
 }
 
 static void f2fs_truncate_quota_inode_pages(struct super_block *sb)