============================================ WARNING: possible recursive locking detected 5.17.0-rc5-next-20220222-syzkaller #0 Not tainted -------------------------------------------- syz-executor.1/3629 is trying to acquire lock: ffff88801a080390 (&sem->internal_rwsem#2){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2160 [inline] ffff88801a080390 (&sem->internal_rwsem#2){++++}-{3:3}, at: f2fs_write_checkpoint+0x535/0x5ea0 fs/f2fs/checkpoint.c:1620 but task is already holding lock: ffff88801a081398 (&sem->internal_rwsem#2){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2160 [inline] ffff88801a081398 (&sem->internal_rwsem#2){++++}-{3:3}, at: f2fs_issue_checkpoint+0x149/0x480 fs/f2fs/checkpoint.c:1839 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&sem->internal_rwsem#2); lock(&sem->internal_rwsem#2); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by syz-executor.1/3629: #0: ffff888046c5e0e0 (&type->s_umount_key#50){+.+.}-{3:3}, at: deactivate_super+0xa5/0xd0 fs/super.c:362 #1: ffff88801a081398 (&sem->internal_rwsem#2){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2160 [inline] #1: ffff88801a081398 (&sem->internal_rwsem#2){++++}-{3:3}, at: f2fs_issue_checkpoint+0x149/0x480 fs/f2fs/checkpoint.c:1839 stack backtrace: CPU: 0 PID: 3629 Comm: syz-executor.1 Not tainted 5.17.0-rc5-next-20220222-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2989 [inline] check_deadlock kernel/locking/lockdep.c:3032 [inline] validate_chain kernel/locking/lockdep.c:3821 [inline] __lock_acquire.cold+0x12c/0x3a7 kernel/locking/lockdep.c:5060 lock_acquire kernel/locking/lockdep.c:5672 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5637 down_write+0x90/0x150 kernel/locking/rwsem.c:1514 f2fs_down_write fs/f2fs/f2fs.h:2160 [inline] f2fs_write_checkpoint+0x535/0x5ea0 fs/f2fs/checkpoint.c:1620 __write_checkpoint_sync fs/f2fs/checkpoint.c:1750 [inline] f2fs_issue_checkpoint+0x156/0x480 fs/f2fs/checkpoint.c:1847 f2fs_sync_fs+0x20f/0x420 fs/f2fs/super.c:1645 sync_filesystem.part.0+0x13c/0x1d0 fs/sync.c:66 sync_filesystem+0x8b/0xc0 fs/sync.c:43 generic_shutdown_super+0x70/0x400 fs/super.c:445 kill_block_super+0x97/0xf0 fs/super.c:1394 kill_f2fs_super+0x2b3/0x3c0 fs/f2fs/super.c:4534 deactivate_locked_super+0x94/0x160 fs/super.c:332 deactivate_super+0xad/0xd0 fs/super.c:363 cleanup_mnt+0x3a2/0x540 fs/namespace.c:1171 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:176 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f7fcf08a4b7 Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffec57ab638 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f7fcf08a4b7 RDX: 00007ffec57ab708 RSI: 000000000000000a RDI: 00007ffec57ab700 RBP: 00007ffec57ab700 R08: 00000000ffffffff R09: 00007ffec57ab4d0 R10: 00005555569ff8b3 R11: 0000000000000246 R12: 00007f7fcf0e21ea R13: 00007ffec57ac7c0 R14: 00005555569ff810 R15: 00007ffec57ac800