====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc4-next-20230117 #1 Not tainted ------------------------------------------------------ syz-executor.7/67044 is trying to acquire lock: ffff88800f54e3f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: __jbd2_log_wait_for_space+0x238/0x460 but task is already holding lock: ffff888043d717e0 (&sb->s_type->i_mutex_key#6){++++}-{3:3}, at: ext4_buffered_write_iter+0xb0/0x460 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+0x9e3/0x43e0 __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_dirty_inode+0xa5/0x130 __mark_inode_dirty+0x1aa/0xee0 generic_update_time+0x21b/0x2b0 file_modified_flags+0x2d4/0x330 ext4_buffered_write_iter+0xf9/0x460 ext4_file_write_iter+0x3ff/0x1930 __kernel_write_iter+0x264/0x740 __kernel_write+0xcb/0x110 do_acct_process+0xd8a/0x1400 acct_process+0x40c/0x570 do_exit+0x17ee/0x2780 do_group_exit+0xd4/0x2a0 get_signal+0x2255/0x2390 arch_do_signal_or_restart+0x79/0x5a0 exit_to_user_mode_prepare+0xf5/0x190 syscall_exit_to_user_mode+0x1d/0x50 do_syscall_64+0x4c/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.7/67044: #0: ffff88804a7efd00 (&acct->lock#2){+.+.}-{3:3}, at: acct_process+0x1e2/0x570 #1: ffff88800f54a438 (sb_writers#3){.+.+}-{0:0}, at: acct_process+0x40c/0x570 #2: ffff888043d717e0 (&sb->s_type->i_mutex_key#6){++++}-{3:3}, at: ext4_buffered_write_iter+0xb0/0x460 stack backtrace: CPU: 1 PID: 67044 Comm: syz-executor.7 Not tainted 6.2.0-rc4-next-20230117 #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_dirty_inode+0xa5/0x130 __mark_inode_dirty+0x1aa/0xee0 generic_update_time+0x21b/0x2b0 file_modified_flags+0x2d4/0x330 ext4_buffered_write_iter+0xf9/0x460 ext4_file_write_iter+0x3ff/0x1930 __kernel_write_iter+0x264/0x740 __kernel_write+0xcb/0x110 do_acct_process+0xd8a/0x1400 acct_process+0x40c/0x570 do_exit+0x17ee/0x2780 do_group_exit+0xd4/0x2a0 get_signal+0x2255/0x2390 arch_do_signal_or_restart+0x79/0x5a0 exit_to_user_mode_prepare+0xf5/0x190 syscall_exit_to_user_mode+0x1d/0x50 do_syscall_64+0x4c/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7fc506c938ac Code: Unable to access opcode bytes at 0x7fc506c93882. RSP: 002b:00007fc504255020 EFLAGS: 00000293 ORIG_RAX: 000000000000002c RAX: 0000000000000020 RBX: 00007fc504255110 RCX: 00007fc506c938ac RDX: 0000000000000020 RSI: 00007fc504255160 RDI: 0000000000000003 RBP: 0000000000000000 R08: 00007fc504255074 R09: 000000000000000c R10: 0000000000000000 R11: 0000000000000293 R12: 00007fc5042550c8 R13: 00007fc504255160 R14: 0000000000000003 R15: 0000000000000000 Bluetooth: hci1: unexpected cc 0x0c03 length: 249 > 1 Bluetooth: hci1: unexpected cc 0x1003 length: 249 > 9 Bluetooth: hci1: unexpected cc 0x1001 length: 249 > 9 Bluetooth: hci1: unexpected cc 0x0c23 length: 249 > 4 Bluetooth: hci1: unexpected cc 0x0c25 length: 249 > 3 Bluetooth: hci1: unexpected cc 0x0c38 length: 249 > 2 Bluetooth: hci1: unexpected cc 0x0c03 length: 249 > 1 Bluetooth: hci1: unexpected cc 0x1003 length: 249 > 9 Bluetooth: hci1: unexpected cc 0x1001 length: 249 > 9 Bluetooth: hci1: unexpected cc 0x0c23 length: 249 > 4 Bluetooth: hci1: unexpected cc 0x0c25 length: 249 > 3 Bluetooth: hci1: unexpected cc 0x0c38 length: 249 > 2 Bluetooth: hci1: command 0x0409 tx timeout Bluetooth: hci1: command 0x041b tx timeout Bluetooth: hci1: command 0x040f tx timeout