====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.6.595/6846 is trying to acquire lock: ffff888020f14170 (&journal->j_barrier){+.+.}-{3:3}, at: jbd2_journal_lock_updates+0x2ce/0x390 fs/jbd2/transaction.c:905 but task is already holding lock: ffff88802272e7a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:793 [inline] ffff88802272e7a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_dio_write_checks fs/ext4/file.c:429 [inline] ffff88802272e7a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_dio_write_iter fs/ext4/file.c:497 [inline] ffff88802272e7a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_file_write_iter+0xefd/0x1720 fs/ext4/file.c:667 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sb->s_type->i_mutex_key#9){++++}-{3:3}: down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 inode_lock_shared include/linux/fs.h:803 [inline] ext4_bmap+0x4f/0x3f0 fs/ext4/inode.c:3166 bmap+0xa2/0xd0 fs/inode.c:1817 jbd2_journal_bmap fs/jbd2/journal.c:981 [inline] jbd2_fc_get_buf+0x1ab/0x390 fs/jbd2/journal.c:895 ext4_fc_reserve_space+0x4fa/0x890 fs/ext4/fast_commit.c:705 ext4_fc_add_tlv+0xab/0x570 fs/ext4/fast_commit.c:797 ext4_fc_perform_commit fs/ext4/fast_commit.c:1122 [inline] ext4_fc_commit+0xb08/0x1380 fs/ext4/fast_commit.c:1235 ext4_fsync_journal fs/ext4/fsync.c:115 [inline] ext4_sync_file+0x550/0xb10 fs/ext4/fsync.c:174 generic_write_sync include/linux/fs.h:3001 [inline] ext4_buffered_write_iter+0x32b/0x3a0 fs/ext4/file.c:282 ext4_file_write_iter+0x73f/0x1720 fs/ext4/file.c:-1 call_write_iter include/linux/fs.h:2179 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_pwrite64 fs/read_write.c:701 [inline] __do_sys_pwrite64 fs/read_write.c:711 [inline] __se_sys_pwrite64 fs/read_write.c:708 [inline] __x64_sys_pwrite64+0x197/0x220 fs/read_write.c:708 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&journal->j_barrier){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3120 [inline] check_prevs_add kernel/locking/lockdep.c:3239 [inline] validate_chain kernel/locking/lockdep.c:3855 [inline] __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737 __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 jbd2_journal_lock_updates+0x2ce/0x390 fs/jbd2/transaction.c:905 jbd2_fc_begin_commit+0x2ea/0x330 fs/jbd2/journal.c:761 ext4_fc_commit+0x283/0x1380 fs/ext4/fast_commit.c:1208 ext4_fsync_journal fs/ext4/fsync.c:115 [inline] ext4_sync_file+0x550/0xb10 fs/ext4/fsync.c:174 generic_write_sync include/linux/fs.h:3001 [inline] iomap_dio_complete+0x465/0x6d0 fs/iomap/direct-io.c:128 ext4_dio_write_iter fs/ext4/file.c:547 [inline] ext4_file_write_iter+0x12e6/0x1720 fs/ext4/file.c:667 do_iter_readv_writev+0x47d/0x5f0 fs/read_write.c:-1 do_iter_write+0x1f8/0x7a0 fs/read_write.c:855 iter_file_splice_write+0x6be/0xcf0 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0xe1/0x130 fs/splice.c:956 splice_direct_to_actor+0x4e8/0xc00 fs/splice.c:902 do_splice_direct+0x1d4/0x2f0 fs/splice.c:1008 do_sendfile+0x524/0xe30 fs/read_write.c:1249 __do_sys_sendfile64 fs/read_write.c:1317 [inline] __se_sys_sendfile64+0x141/0x1a0 fs/read_write.c:1303 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#9); lock(&journal->j_barrier); lock(&sb->s_type->i_mutex_key#9); lock(&journal->j_barrier); *** DEADLOCK *** 2 locks held by syz.6.595/6846: #0: ffff8880779ce460 (sb_writers#5){++++}-{0:0}, at: do_sendfile+0x4ff/0xe30 fs/read_write.c:1248 #1: ffff88802272e7a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:793 [inline] #1: ffff88802272e7a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_dio_write_checks fs/ext4/file.c:429 [inline] #1: ffff88802272e7a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_dio_write_iter fs/ext4/file.c:497 [inline] #1: ffff88802272e7a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_file_write_iter+0xefd/0x1720 fs/ext4/file.c:667 stack backtrace: CPU: 0 PID: 6846 Comm: syz.6.595 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3120 [inline] check_prevs_add kernel/locking/lockdep.c:3239 [inline] validate_chain kernel/locking/lockdep.c:3855 [inline] __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737 __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 jbd2_journal_lock_updates+0x2ce/0x390 fs/jbd2/transaction.c:905 jbd2_fc_begin_commit+0x2ea/0x330 fs/jbd2/journal.c:761 ext4_fc_commit+0x283/0x1380 fs/ext4/fast_commit.c:1208 ext4_fsync_journal fs/ext4/fsync.c:115 [inline] ext4_sync_file+0x550/0xb10 fs/ext4/fsync.c:174 generic_write_sync include/linux/fs.h:3001 [inline] iomap_dio_complete+0x465/0x6d0 fs/iomap/direct-io.c:128 ext4_dio_write_iter fs/ext4/file.c:547 [inline] ext4_file_write_iter+0x12e6/0x1720 fs/ext4/file.c:667 do_iter_readv_writev+0x47d/0x5f0 fs/read_write.c:-1 do_iter_write+0x1f8/0x7a0 fs/read_write.c:855 iter_file_splice_write+0x6be/0xcf0 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0xe1/0x130 fs/splice.c:956 splice_direct_to_actor+0x4e8/0xc00 fs/splice.c:902 do_splice_direct+0x1d4/0x2f0 fs/splice.c:1008 do_sendfile+0x524/0xe30 fs/read_write.c:1249 __do_sys_sendfile64 fs/read_write.c:1317 [inline] __se_sys_sendfile64+0x141/0x1a0 fs/read_write.c:1303 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f71d1a5b4d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f71cfca8028 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f71d1cd7fa0 RCX: 00007f71d1a5b4d9 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000004 RBP: 00007f71d1aea04e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000800000009 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f71d1cd8038 R14: 00007f71d1cd7fa0 R15: 00007ffc7fe346b8