====================================================== WARNING: possible circular locking dependency detected 6.2.0-syzkaller-12944-ge492250d5252 #0 Not tainted ------------------------------------------------------ syz-executor.1/16298 is trying to acquire lock: ffff88814b4ac990 (jbd2_handle){++++}-{0:0}, at: jbd2_log_wait_commit+0x146/0x430 fs/jbd2/journal.c:689 but task is already holding lock: ffff888038a80580 (&type->i_mutex_dir_key#3/4){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] ffff888038a80580 (&type->i_mutex_dir_key#3/4){+.+.}-{3:3}, at: ext4_rename+0x1924/0x26d0 fs/ext4/namei.c:3879 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&type->i_mutex_dir_key#3/4){+.+.}-{3:3}: down_write_nested+0x96/0x200 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] ext4_rename+0x1924/0x26d0 fs/ext4/namei.c:3879 ext4_rename2+0x1c7/0x270 fs/ext4/namei.c:4193 vfs_rename+0xef6/0x17a0 fs/namei.c:4772 do_renameat2+0xb62/0xc90 fs/namei.c:4923 __do_sys_renameat2 fs/namei.c:4956 [inline] __se_sys_renameat2 fs/namei.c:4953 [inline] __x64_sys_renameat2+0xe8/0x120 fs/namei.c:4953 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (jbd2_handle){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1e3/0x670 kernel/locking/lockdep.c:5634 jbd2_log_wait_commit+0x17b/0x430 fs/jbd2/journal.c:692 jbd2_journal_stop+0x5f5/0xfd0 fs/jbd2/transaction.c:1959 __ext4_journal_stop+0xe2/0x1f0 fs/ext4/ext4_jbd2.c:133 ext4_rename+0x1470/0x26d0 fs/ext4/namei.c:4011 ext4_rename2+0x1c7/0x270 fs/ext4/namei.c:4193 vfs_rename+0xef6/0x17a0 fs/namei.c:4772 do_renameat2+0xb62/0xc90 fs/namei.c:4923 __do_sys_renameat2 fs/namei.c:4956 [inline] __se_sys_renameat2 fs/namei.c:4953 [inline] __x64_sys_renameat2+0xe8/0x120 fs/namei.c:4953 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&type->i_mutex_dir_key#3/4); lock(jbd2_handle); lock(&type->i_mutex_dir_key#3/4); lock(jbd2_handle); *** DEADLOCK *** 5 locks held by syz-executor.1/16298: #0: ffff88814b4a8460 (sb_writers#5){.+.+}-{0:0}, at: do_renameat2+0x37f/0xc90 fs/namei.c:4859 #1: ffff88814b4a8748 (&type->s_vfs_rename_key#2){+.+.}-{3:3}, at: lock_rename+0x58/0x280 fs/namei.c:2995 #2: ffff88802da4f840 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #2: ffff88802da4f840 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_rename+0x136/0x280 fs/namei.c:3006 #3: ffff888038a5f500 (&type->i_mutex_dir_key#3/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #3: ffff888038a5f500 (&type->i_mutex_dir_key#3/2){+.+.}-{3:3}, at: lock_rename+0x16a/0x280 fs/namei.c:3007 #4: ffff888038a80580 (&type->i_mutex_dir_key#3/4){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #4: ffff888038a80580 (&type->i_mutex_dir_key#3/4){+.+.}-{3:3}, at: ext4_rename+0x1924/0x26d0 fs/ext4/namei.c:3879 stack backtrace: CPU: 1 PID: 16298 Comm: syz-executor.1 Not tainted 6.2.0-syzkaller-12944-ge492250d5252 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1e3/0x670 kernel/locking/lockdep.c:5634 jbd2_log_wait_commit+0x17b/0x430 fs/jbd2/journal.c:692 jbd2_journal_stop+0x5f5/0xfd0 fs/jbd2/transaction.c:1959 __ext4_journal_stop+0xe2/0x1f0 fs/ext4/ext4_jbd2.c:133 ext4_rename+0x1470/0x26d0 fs/ext4/namei.c:4011 ext4_rename2+0x1c7/0x270 fs/ext4/namei.c:4193 vfs_rename+0xef6/0x17a0 fs/namei.c:4772 do_renameat2+0xb62/0xc90 fs/namei.c:4923 __do_sys_renameat2 fs/namei.c:4956 [inline] __se_sys_renameat2 fs/namei.c:4953 [inline] __x64_sys_renameat2+0xe8/0x120 fs/namei.c:4953 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f4ea728c0f9 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:00007f4ea8035168 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007f4ea73abf80 RCX: 00007f4ea728c0f9 RDX: 0000000000000004 RSI: 0000000020000140 RDI: 0000000000000004 RBP: 00007f4ea72e7ae9 R08: 0000000000000004 R09: 0000000000000000 R10: 00000000200002c0 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd4a5ca35f R14: 00007f4ea8035300 R15: 0000000000022000