====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc2-syzkaller-00010-g69b41ac87e4a #0 Not tainted ------------------------------------------------------ syz-executor.5/20738 is trying to acquire lock: ffff88802a04e650 (sb_internal){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1811 [inline] ffff88802a04e650 (sb_internal){.+.+}-{0:0}, at: sb_start_intwrite include/linux/fs.h:1933 [inline] ffff88802a04e650 (sb_internal){.+.+}-{0:0}, at: ext4_evict_inode+0x4cd/0x10b0 fs/ext4/inode.c:240 but task is already holding lock: ffff88804a167258 (&sb->s_type->i_mutex_key#7/4){+.+.}-{3:3}, at: vfs_rename+0x81e/0x1150 fs/namei.c:4749 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&sb->s_type->i_mutex_key#7/4){+.+.}-{3:3}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 down_write_nested+0xa2/0x280 kernel/locking/rwsem.c:1672 ext4_move_extents+0x379/0xed0 fs/ext4/move_extent.c:613 __ext4_ioctl fs/ext4/ioctl.c:1354 [inline] ext4_ioctl+0x36eb/0x5400 fs/ext4/ioctl.c:1610 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #2 (&sb->s_type->i_mutex_key#7){++++}-{3:3}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 down_read+0x39/0x50 kernel/locking/rwsem.c:1509 inode_lock_shared include/linux/fs.h:766 [inline] ext4_bmap+0x55/0x410 fs/ext4/inode.c:3243 bmap+0xa1/0xd0 fs/inode.c:1798 jbd2_journal_bmap fs/jbd2/journal.c:977 [inline] __jbd2_journal_erase fs/jbd2/journal.c:1789 [inline] jbd2_journal_flush+0x5d0/0xca0 fs/jbd2/journal.c:2492 ext4_ioctl_checkpoint fs/ext4/ioctl.c:1082 [inline] __ext4_ioctl fs/ext4/ioctl.c:1590 [inline] ext4_ioctl+0x3288/0x5400 fs/ext4/ioctl.c:1610 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (&journal->j_checkpoint_mutex){+.+.}-{3:3}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 __mutex_lock_common+0x1de/0x26c0 kernel/locking/mutex.c:603 mutex_lock_io_nested+0x43/0x60 kernel/locking/mutex.c:833 __jbd2_log_wait_for_space+0x22d/0x790 fs/jbd2/checkpoint.c:110 add_transaction_credits+0x936/0xbf0 fs/jbd2/transaction.c:298 start_this_handle+0x758/0x1660 fs/jbd2/transaction.c:422 jbd2__journal_start+0x2ca/0x5b0 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x13b/0x1f0 fs/ext4/ext4_jbd2.c:111 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_evict_inode+0x978/0x10b0 fs/ext4/inode.c:251 evict+0x2a4/0x620 fs/inode.c:664 do_unlinkat+0x522/0x990 fs/namei.c:4327 __do_sys_unlink fs/namei.c:4368 [inline] __se_sys_unlink fs/namei.c:4366 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4366 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (sb_internal){.+.+}-{0:0}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 percpu_down_read+0x44/0x190 include/linux/percpu-rwsem.h:51 __sb_start_write include/linux/fs.h:1811 [inline] sb_start_intwrite include/linux/fs.h:1933 [inline] ext4_evict_inode+0x4cd/0x10b0 fs/ext4/inode.c:240 evict+0x2a4/0x620 fs/inode.c:664 ext4_rename fs/ext4/namei.c:4005 [inline] ext4_rename2+0x4069/0x4750 fs/ext4/namei.c:4184 vfs_rename+0xd67/0x1150 fs/namei.c:4779 do_renameat2+0xb7f/0x13e0 fs/namei.c:4930 __do_sys_renameat2 fs/namei.c:4963 [inline] __se_sys_renameat2 fs/namei.c:4960 [inline] __x64_sys_renameat2+0xce/0xe0 fs/namei.c:4960 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: sb_internal --> &sb->s_type->i_mutex_key#7 --> &sb->s_type->i_mutex_key#7/4 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#7/4); lock(&sb->s_type->i_mutex_key#7); lock(&sb->s_type->i_mutex_key#7/4); lock(sb_internal); *** DEADLOCK *** 5 locks held by syz-executor.5/20738: #0: ffff88802a04e460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:508 #1: ffff88802a04e748 (&type->s_vfs_rename_key){+.+.}-{3:3}, at: lock_rename+0x54/0x1a0 fs/namei.c:2994 #2: ffff88802e4f2218 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #2: ffff88802e4f2218 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_rename+0xa0/0x1a0 fs/namei.c:2998 #3: ffff88804a164a38 (&type->i_mutex_dir_key#3/2){+.+.}-{3:3}, at: lock_rename+0x16e/0x1a0 #4: ffff88804a167258 (&sb->s_type->i_mutex_key#7/4){+.+.}-{3:3}, at: vfs_rename+0x81e/0x1150 fs/namei.c:4749 stack backtrace: CPU: 1 PID: 20738 Comm: syz-executor.5 Not tainted 6.2.0-rc2-syzkaller-00010-g69b41ac87e4a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f9/0x3b0 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 percpu_down_read+0x44/0x190 include/linux/percpu-rwsem.h:51 __sb_start_write include/linux/fs.h:1811 [inline] sb_start_intwrite include/linux/fs.h:1933 [inline] ext4_evict_inode+0x4cd/0x10b0 fs/ext4/inode.c:240 evict+0x2a4/0x620 fs/inode.c:664 ext4_rename fs/ext4/namei.c:4005 [inline] ext4_rename2+0x4069/0x4750 fs/ext4/namei.c:4184 vfs_rename+0xd67/0x1150 fs/namei.c:4779 do_renameat2+0xb7f/0x13e0 fs/namei.c:4930 __do_sys_renameat2 fs/namei.c:4963 [inline] __se_sys_renameat2 fs/namei.c:4960 [inline] __x64_sys_renameat2+0xce/0xe0 fs/namei.c:4960 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f826448c0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007f8265211168 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007f82645abf80 RCX: 00007f826448c0c9 RDX: 0000000000000003 RSI: 0000000020000080 RDI: 0000000000000004 RBP: 00007f82644e7ae9 R08: 0000000000000004 R09: 0000000000000000 R10: 00000000200000c0 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc122cd8af R14: 00007f8265211300 R15: 0000000000022000