====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc5-next-20230123 #1 Not tainted ------------------------------------------------------ syz-executor.5/23053 is trying to acquire lock: ffff88800ff863f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: __jbd2_log_wait_for_space+0x238/0x460 but task is already holding lock: ffff8880414d4990 (&sb->s_type->i_mutex_key#6){++++}-{3:3}, at: vfs_unlink+0xd9/0x930 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sb->s_type->i_mutex_key#6){++++}-{3:3}: down_read+0x9c/0x450 ext4_bmap+0x52/0x470 bmap+0xb0/0x130 jbd2_journal_bmap+0xac/0x190 jbd2_journal_flush+0x860/0xc10 __ext4_ioctl+0x9fd/0x42a0 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #0 (&journal->j_checkpoint_mutex){+.+.}-{3:3}: __lock_acquire+0x2a52/0x5e90 lock_acquire.part.0+0x120/0x340 mutex_lock_io_nested+0x14c/0x1300 __jbd2_log_wait_for_space+0x238/0x460 add_transaction_credits+0xa42/0xb80 start_this_handle+0x3ac/0x14c0 jbd2__journal_start+0x394/0x6b0 __ext4_journal_start_sb+0x4c2/0x6f0 __ext4_unlink+0x44e/0xcf0 ext4_unlink+0x3ac/0x640 vfs_unlink+0x35e/0x930 do_unlinkat+0x3b9/0x650 __x64_sys_unlink+0xca/0x110 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#6); lock(&journal->j_checkpoint_mutex); lock(&sb->s_type->i_mutex_key#6); lock(&journal->j_checkpoint_mutex); *** DEADLOCK *** 3 locks held by syz-executor.5/23053: #0: ffff88800ff82438 (sb_writers#3){.+.+}-{0:0}, at: do_unlinkat+0x190/0x650 #1: ffff8880414d35b0 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: do_unlinkat+0x280/0x650 #2: ffff8880414d4990 (&sb->s_type->i_mutex_key#6){++++}-{3:3}, at: vfs_unlink+0xd9/0x930 stack backtrace: CPU: 0 PID: 23053 Comm: syz-executor.5 Not tainted 6.2.0-rc5-next-20230123 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x8f/0xb7 check_noncircular+0x263/0x2e0 __lock_acquire+0x2a52/0x5e90 lock_acquire.part.0+0x120/0x340 mutex_lock_io_nested+0x14c/0x1300 __jbd2_log_wait_for_space+0x238/0x460 add_transaction_credits+0xa42/0xb80 start_this_handle+0x3ac/0x14c0 jbd2__journal_start+0x394/0x6b0 __ext4_journal_start_sb+0x4c2/0x6f0 __ext4_unlink+0x44e/0xcf0 ext4_unlink+0x3ac/0x640 vfs_unlink+0x35e/0x930 do_unlinkat+0x3b9/0x650 __x64_sys_unlink+0xca/0x110 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f8b1b102457 Code: 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 57 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd18b5fa78 EFLAGS: 00000206 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f8b1b102457 RDX: 00007ffd18b5fab0 RSI: 00007ffd18b5fab0 RDI: 00007ffd18b5fb40 RBP: 00007ffd18b5fb40 R08: 0000000000000001 R09: 00007ffd18b5f910 R10: 000055555722ec9b R11: 0000000000000206 R12: 00007f8b1b15c105 R13: 00007ffd18b60c00 R14: 000055555722ec20 R15: 00007ffd18b60c40 hpet: Lost 5 RTC interrupts netlink: 500 bytes leftover after parsing attributes in process `syz-executor.7'. ieee80211 phy100: Selected rate control algorithm 'minstrel_ht' netlink: 500 bytes leftover after parsing attributes in process `syz-executor.7'. ieee80211 phy101: Selected rate control algorithm 'minstrel_ht' netlink: 500 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 500 bytes leftover after parsing attributes in process `syz-executor.7'. ieee80211 phy102: Selected rate control algorithm 'minstrel_ht' ieee80211 phy103: Selected rate control algorithm 'minstrel_ht' ieee80211 phy104: Selected rate control algorithm 'minstrel_ht'