linux-stable/fs/f2fs
Chao Yu f2db71053d f2fs: fix to clear dirty inode in f2fs_evict_inode()
As Yanming reported in bugzilla:

https://bugzilla.kernel.org/show_bug.cgi?id=215904

The kernel message is shown below:

kernel BUG at fs/f2fs/inode.c:825!
Call Trace:
 evict+0x282/0x4e0
 __dentry_kill+0x2b2/0x4d0
 shrink_dentry_list+0x17c/0x4f0
 shrink_dcache_parent+0x143/0x1e0
 do_one_tree+0x9/0x30
 shrink_dcache_for_umount+0x51/0x120
 generic_shutdown_super+0x5c/0x3a0
 kill_block_super+0x90/0xd0
 kill_f2fs_super+0x225/0x310
 deactivate_locked_super+0x78/0xc0
 cleanup_mnt+0x2b7/0x480
 task_work_run+0xc8/0x150
 exit_to_user_mode_prepare+0x14a/0x150
 syscall_exit_to_user_mode+0x1d/0x40
 do_syscall_64+0x48/0x90

The root cause is: inode node and dnode node share the same nid,
so during f2fs_evict_inode(), dnode node truncation will invalidate
its NAT entry, so when truncating inode node, it fails due to
invalid NAT entry, result in inode is still marked as dirty, fix
this issue by clearing dirty for inode and setting SBI_NEED_FSCK
flag in filesystem.

output from dump.f2fs:
[print_node_info: 354] Node ID [0xf:15] is inode
i_nid[0]                      		[0x       f : 15]

Cc: stable@vger.kernel.org
Reported-by: Ming Yan <yanming@tju.edu.cn>
Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2022-05-06 10:18:12 -07:00
..
acl.c f2fs: support idmapped mounts 2022-02-12 06:20:46 -08:00
acl.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
checkpoint.c f2fs: avoid infinite loop to flush node pages 2022-05-06 10:18:11 -07:00
compress.c Filesystem folio changes for 5.18 2022-03-22 18:26:56 -07:00
data.c f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders 2022-04-20 11:16:43 -07:00
debug.c f2fs: introduce gc_urgent_mid mode 2022-03-17 09:16:22 -07:00
dir.c f2fs-for-5.18 2022-03-22 10:00:31 -07:00
extent_cache.c f2fs: support fault injection for f2fs_kmem_cache_alloc() 2021-08-17 11:59:05 -07:00
f2fs.h f2fs: avoid infinite loop to flush node pages 2022-05-06 10:18:11 -07:00
file.c f2fs: use flush command instead of FUA for zoned device 2022-05-06 10:18:11 -07:00
gc.c f2fs: don't set GC_FAILURE_PIN for background GC 2022-04-25 15:13:02 -07:00
gc.h f2fs: introduce gc_merge mount option 2021-03-30 18:48:56 -07:00
hash.c unicode: clean up the Kconfig symbol confusion 2022-01-20 19:57:24 -05:00
inline.c f2fs: move f2fs to use reader-unfair rwsems 2022-01-24 17:40:04 -08:00
inode.c f2fs: fix to clear dirty inode in f2fs_evict_inode() 2022-05-06 10:18:12 -07:00
iostat.c f2fs: use iomap for direct I/O 2021-12-10 15:48:30 -08:00
iostat.h f2fs: introduce periodic iostat io latency traces 2021-08-23 10:25:51 -07:00
Kconfig f2fs: introduce F2FS_UNFAIR_RWSEM to support unfair rwsem 2022-03-04 09:15:53 -08:00
Makefile f2fs: separate out iostat feature 2021-08-23 10:25:51 -07:00
namei.c f2fs: fix to do sanity check on inline_dots inode 2022-04-25 15:13:03 -07:00
node.c f2fs: avoid infinite loop to flush node pages 2022-05-06 10:18:11 -07:00
node.h f2fs: add a way to limit roll forward recovery time 2022-02-12 05:58:18 -08:00
recovery.c f2fs-for-5.18 2022-03-22 10:00:31 -07:00
segment.c f2fs: replace usage of found with dedicated list iterator variable 2022-04-25 15:13:04 -07:00
segment.h f2fs: introduce F2FS_IPU_HONOR_OPU_WRITE ipu policy 2022-02-07 11:28:35 -08:00
shrinker.c f2fs: avoid race condition for shrinker count 2020-12-03 00:59:26 -08:00
super.c f2fs: ensure only power of 2 zone sizes are allowed 2022-05-06 10:18:12 -07:00
sysfs.c f2fs-for-5.18 2022-03-22 10:00:31 -07:00
verity.c f2fs: move f2fs to use reader-unfair rwsems 2022-01-24 17:40:04 -08:00
xattr.c f2fs: move f2fs to use reader-unfair rwsems 2022-01-24 17:40:04 -08:00
xattr.h f2fs: code cleanup by removing ifdef macro surrounding 2020-05-26 18:56:10 -07:00