====================================================== WARNING: possible circular locking dependency detected 6.1.0-next-20221213 #1 Not tainted ------------------------------------------------------ syz-executor.2/831 is trying to acquire lock: ffff8880103263f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: __jbd2_log_wait_for_space+0x238/0x460 but task is already holding lock: ffff88801ef2e760 (&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+0x857/0xc10 __ext4_ioctl+0x9be/0x4560 __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+0x2a02/0x5e70 lock_acquire.part.0+0x11e/0x340 mutex_lock_io_nested+0x14c/0x1330 __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+0x4a5/0x6b0 __ext4_unlink+0x44e/0xcf0 ext4_unlink+0x3ac/0x600 vfs_unlink+0x35e/0x930 do_unlinkat+0x398/0x620 __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.2/831: #0: ffff888010322438 (sb_writers#3){.+.+}-{0:0}, at: do_unlinkat+0x187/0x620 #1: ffff88803d877150 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: do_unlinkat+0x274/0x620 #2: ffff88801ef2e760 (&sb->s_type->i_mutex_key#6){++++}-{3:3}, at: vfs_unlink+0xd9/0x930 stack backtrace: CPU: 0 PID: 831 Comm: syz-executor.2 Not tainted 6.1.0-next-20221213 #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+0x2a02/0x5e70 lock_acquire.part.0+0x11e/0x340 mutex_lock_io_nested+0x14c/0x1330 __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+0x4a5/0x6b0 __ext4_unlink+0x44e/0xcf0 ext4_unlink+0x3ac/0x600 vfs_unlink+0x35e/0x930 do_unlinkat+0x398/0x620 __x64_sys_unlink+0xca/0x110 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7fe16f4eb457 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:00007ffd070617a8 EFLAGS: 00000206 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe16f4eb457 RDX: 00007ffd070617e0 RSI: 00007ffd070617e0 RDI: 00007ffd07061870 RBP: 00007ffd07061870 R08: 0000000000000001 R09: 00007ffd07061640 R10: 0000555555e42cbb R11: 0000000000000206 R12: 00007fe16f545105 R13: 00007ffd07062930 R14: 0000555555e42c20 R15: 00007ffd07062970 audit: type=1326 audit(1670929211.724:41): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=107415 comm="syz-executor.2" exe="/syz-executor.2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7fe16f4ebb19 code=0x0 audit: type=1326 audit(1670929212.708:42): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=107445 comm="syz-executor.2" exe="/syz-executor.2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7fe16f4ebb19 code=0x0 audit: type=1326 audit(1670929213.711:43): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=107786 comm="syz-executor.2" exe="/syz-executor.2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7fe16f4ebb19 code=0x0 netlink: 4 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 4 bytes leftover after parsing attributes in process `syz-executor.5'. audit: type=1326 audit(1670929214.656:44): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=108116 comm="syz-executor.2" exe="/syz-executor.2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7fe16f4ebb19 code=0x0 netlink: 4 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 4 bytes leftover after parsing attributes in process `syz-executor.5'. Bluetooth: hci7: command 0x0406 tx timeout ======================================================= WARNING: The mand mount option has been deprecated and and is ignored by this kernel. Remove the mand option from the mount to silence this warning. =======================================================