linux/fs/f2fs
Chao Yu 884ee6dc85 f2fs: get rid of online repaire on corrupted directory
syzbot reports a f2fs bug as below:

kernel BUG at fs/f2fs/inode.c:896!
RIP: 0010:f2fs_evict_inode+0x1598/0x15c0 fs/f2fs/inode.c:896
Call Trace:
 evict+0x532/0x950 fs/inode.c:704
 dispose_list fs/inode.c:747 [inline]
 evict_inodes+0x5f9/0x690 fs/inode.c:797
 generic_shutdown_super+0x9d/0x2d0 fs/super.c:627
 kill_block_super+0x44/0x90 fs/super.c:1696
 kill_f2fs_super+0x344/0x690 fs/f2fs/super.c:4898
 deactivate_locked_super+0xc4/0x130 fs/super.c:473
 cleanup_mnt+0x41f/0x4b0 fs/namespace.c:1373
 task_work_run+0x24f/0x310 kernel/task_work.c:228
 ptrace_notify+0x2d2/0x380 kernel/signal.c:2402
 ptrace_report_syscall include/linux/ptrace.h:415 [inline]
 ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
 syscall_exit_work+0xc6/0x190 kernel/entry/common.c:173
 syscall_exit_to_user_mode_prepare kernel/entry/common.c:200 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:205 [inline]
 syscall_exit_to_user_mode+0x279/0x370 kernel/entry/common.c:218
 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0010:f2fs_evict_inode+0x1598/0x15c0 fs/f2fs/inode.c:896

Online repaire on corrupted directory in f2fs_lookup() can generate
dirty data/meta while racing w/ readonly remount, it may leave dirty
inode after filesystem becomes readonly, however, checkpoint() will
skips flushing dirty inode in a state of readonly mode, result in
above panic.

Let's get rid of online repaire in f2fs_lookup(), and leave the work
to fsck.f2fs.

Fixes: 510022a858 ("f2fs: add F2FS_INLINE_DOTS to recover missing dot dentries")
Reported-by: syzbot+ebea2790904673d7c618@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/000000000000a7b20f061ff2d56a@google.com
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2024-09-11 03:30:27 +00:00
..
acl.c f2fs: Use in_group_or_capable() helper 2024-06-25 11:15:48 +02:00
acl.h fs: port ->set_acl() to pass mnt_idmap 2023-01-19 09:24:27 +01:00
checkpoint.c f2fs: convert f2fs_handle_page_eio() to use folio 2024-09-06 23:04:47 +00:00
compress.c f2fs: get rid of page->index 2024-09-06 23:04:48 +00:00
data.c f2fs: get rid of page->index 2024-09-06 23:04:48 +00:00
debug.c f2fs: clean up val{>>,<<}F2FS_BLKSIZE_BITS 2024-08-21 00:56:27 +00:00
dir.c f2fs: get rid of page->index 2024-09-06 23:04:48 +00:00
extent_cache.c f2fs: fix several potential integer overflows in file offsets 2024-08-05 20:18:35 +00:00
f2fs.h f2fs: get rid of online repaire on corrupted directory 2024-09-11 03:30:27 +00:00
file.c f2fs: convert f2fs_vm_page_mkwrite() to use folio 2024-09-06 23:04:47 +00:00
gc.c f2fs: use meta inode for GC of COW file 2024-07-10 22:48:20 +00:00
gc.h f2fs: fix to limit gc_pin_file_threshold 2024-05-09 01:03:44 +00:00
hash.c f2fs: don't use casefolded comparison for "." and ".." 2022-05-17 11:19:23 -07:00
inline.c f2fs: convert f2fs_write_inline_data() to use folio 2024-09-06 23:04:47 +00:00
inode.c f2fs: prevent atomic file from being dirtied before commit 2024-09-11 03:30:27 +00:00
iostat.c f2fs: add async reset zone command support 2023-06-12 13:04:09 -07:00
iostat.h f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx() 2023-02-07 10:39:28 -08:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile f2fs: separate out iostat feature 2021-08-23 10:25:51 -07:00
namei.c f2fs: get rid of online repaire on corrupted directory 2024-09-11 03:30:27 +00:00
node.c f2fs: get rid of page->index 2024-09-06 23:04:48 +00:00
node.h f2fs: use BLKS_PER_SEG, BLKS_PER_SEC, and SEGS_PER_SEC 2024-02-27 09:41:12 -08:00
recovery.c f2fs update for 6.11-rc1 2024-07-23 15:21:19 -07:00
segment.c f2fs: prevent atomic file from being dirtied before commit 2024-09-11 03:30:27 +00:00
segment.h f2fs: fix start segno of large section 2024-07-09 19:33:50 +00:00
shrinker.c f2fs: add block_age-based extent cache 2022-12-12 14:53:56 -08:00
super.c f2fs: fix to avoid use-after-free in f2fs_stop_gc_thread() 2024-08-21 00:56:28 +00:00
sysfs.c f2fs: Use sysfs_emit_at() to simplify code 2024-08-21 01:02:05 +00:00
verity.c f2fs: fix to use per-inode maxbytes and cleanup 2024-08-15 15:26:40 +00:00
xattr.c f2fs: reduce expensive checkpoint trigger frequency 2024-08-15 15:26:39 +00:00
xattr.h f2fs: move f2fs_xattr_handlers and f2fs_xattr_handler_map to .rodata 2023-10-09 16:24:18 +02:00