====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.652/7505 is trying to acquire lock: ffff8880600367a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock_shared include/linux/fs.h:805 [inline] ffff8880600367a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_bmap+0x4f/0x3f0 fs/ext4/inode.c:3167 but task is already holding lock: ffff888023c9c170 (&journal->j_barrier){+.+.}-{3:3}, at: jbd2_journal_lock_updates+0x2ce/0x390 fs/jbd2/transaction.c:905 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&journal->j_barrier){+.+.}-{3:3}: __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 __ocfs2_flush_truncate_log+0x2b4/0x1110 fs/ocfs2/alloc.c:6031 ocfs2_flush_truncate_log+0x4b/0x60 fs/ocfs2/alloc.c:6078 ocfs2_sync_fs+0x119/0x330 fs/ocfs2/super.c:404 sync_filesystem+0x1be/0x220 fs/sync.c:66 generic_shutdown_super+0x6b/0x300 fs/super.c:448 kill_block_super+0x7c/0xe0 fs/super.c:1438 deactivate_locked_super+0x93/0xf0 fs/super.c:335 cleanup_mnt+0x426/0x4d0 fs/namespace.c:1148 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217 __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #4 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type] #6 ){+.+.}-{3:3}: down_write+0x38/0x60 kernel/locking/rwsem.c:1551 inode_lock include/linux/fs.h:795 [inline] ocfs2_remove_btree_range+0x64f/0x15e0 fs/ocfs2/alloc.c:5746 ocfs2_remove_inode_range+0xf4a/0x2610 fs/ocfs2/file.c:1935 ocfs2_reflink_remap_extent fs/ocfs2/refcounttree.c:4598 [inline] ocfs2_reflink_remap_blocks+0xc6b/0x1ab0 fs/ocfs2/refcounttree.c:4745 ocfs2_remap_file_range+0x4a7/0x740 fs/ocfs2/file.c:2736 vfs_copy_file_range+0xf5c/0x1520 fs/read_write.c:1512 __do_sys_copy_file_range fs/read_write.c:1590 [inline] __se_sys_copy_file_range+0x320/0x470 fs/read_write.c:1553 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 -> #3 (&oi->ip_alloc_sem ){++++}-{3:3}: down_write+0x38/0x60 kernel/locking/rwsem.c:1551 ocfs2_page_mkwrite+0x2c4/0xaa0 fs/ocfs2/mmap.c:141 do_page_mkwrite+0x168/0x3c0 mm/memory.c:2929 wp_page_shared+0x163/0x6c0 mm/memory.c:3268 handle_pte_fault mm/memory.c:4677 [inline] __handle_mm_fault mm/memory.c:4794 [inline] handle_mm_fault+0x1fbd/0x4440 mm/memory.c:4892 do_user_addr_fault+0x494/0xc90 arch/x86/mm/fault.c:1355 handle_page_fault arch/x86/mm/fault.c:1443 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1496 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 -> #2 (sb_pagefaults#3){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1819 [inline] sb_start_pagefault include/linux/fs.h:1918 [inline] ocfs2_page_mkwrite+0x1a7/0xaa0 fs/ocfs2/mmap.c:121 do_page_mkwrite+0x168/0x3c0 mm/memory.c:2929 wp_page_shared+0x163/0x6c0 mm/memory.c:3268 handle_pte_fault mm/memory.c:4677 [inline] __handle_mm_fault mm/memory.c:4794 [inline] handle_mm_fault+0x1fbd/0x4440 mm/memory.c:4892 do_user_addr_fault+0x494/0xc90 arch/x86/mm/fault.c:1355 handle_page_fault arch/x86/mm/fault.c:1443 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1496 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:205 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] copyout lib/iov_iter.c:157 [inline] copy_page_to_iter_iovec lib/iov_iter.c:228 [inline] __copy_page_to_iter lib/iov_iter.c:861 [inline] copy_page_to_iter+0x4c9/0x930 lib/iov_iter.c:889 filemap_read+0x1e0a/0x2560 mm/filemap.c:2714 ocfs2_file_read_iter+0x288/0xab0 fs/ocfs2/file.c:2622 call_read_iter include/linux/fs.h:2175 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0x75e/0xd50 fs/read_write.c:485 ksys_read+0x153/0x260 fs/read_write.c:623 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 -> #1 (&mm->mmap_lock){++++}-{3:3}: internal_get_user_pages_fast+0x212/0x2130 mm/gup.c:2898 iov_iter_get_pages+0x228/0x5f0 lib/iov_iter.c:1544 __bio_iov_iter_get_pages block/bio.c:1136 [inline] bio_iov_iter_get_pages+0x46c/0x1890 block/bio.c:1195 iomap_dio_bio_iter+0xb94/0x1470 fs/iomap/direct-io.c:325 iomap_dio_iter fs/iomap/direct-io.c:-1 [inline] __iomap_dio_rw+0xd64/0x1ba0 fs/iomap/direct-io.c:590 iomap_dio_rw+0x38/0x90 fs/iomap/direct-io.c:676 ext4_dio_write_iter fs/ext4/file.c:547 [inline] ext4_file_write_iter+0x12e6/0x1720 fs/ext4/file.c:667 call_write_iter include/linux/fs.h:2181 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x748/0xd70 fs/read_write.c:594 ksys_write+0x153/0x260 fs/read_write.c:647 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 (&sb->s_type->i_mutex_key#9){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3125 [inline] check_prevs_add kernel/locking/lockdep.c:3244 [inline] validate_chain kernel/locking/lockdep.c:3860 [inline] __lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751 down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 inode_lock_shared include/linux/fs.h:805 [inline] ext4_bmap+0x4f/0x3f0 fs/ext4/inode.c:3167 bmap+0xa2/0xd0 fs/inode.c:1828 jbd2_journal_bmap fs/jbd2/journal.c:981 [inline] jbd2_fc_get_buf+0x17b/0x350 fs/jbd2/journal.c:894 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:3003 [inline] ext4_buffered_write_iter+0x32b/0x3a0 fs/ext4/file.c:282 ext4_file_write_iter+0x73f/0x1720 fs/ext4/file.c:-1 do_iter_readv_writev+0x47d/0x5f0 fs/read_write.c:-1 do_iter_write+0x1f8/0x7a0 fs/read_write.c:855 vfs_writev fs/read_write.c:928 [inline] do_pwritev+0x241/0x3a0 fs/read_write.c:1025 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: Chain exists of: &sb->s_type->i_mutex_key#9 --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6 --> &journal->j_barrier Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&journal->j_barrier); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6); lock(&journal->j_barrier); rlock(&sb->s_type->i_mutex_key#9); *** DEADLOCK *** 2 locks held by syz.2.652/7505: #0: ffff888021ad0460 (sb_writers#5){.+.+}-{0:0}, at: vfs_writev fs/read_write.c:927 [inline] #0: ffff888021ad0460 (sb_writers#5){.+.+}-{0:0}, at: do_pwritev+0x22a/0x3a0 fs/read_write.c:1025 #1: ffff888023c9c170 (&journal->j_barrier){+.+.}-{3:3}, at: jbd2_journal_lock_updates+0x2ce/0x390 fs/jbd2/transaction.c:905 stack backtrace: CPU: 0 PID: 7505 Comm: syz.2.652 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:3125 [inline] check_prevs_add kernel/locking/lockdep.c:3244 [inline] validate_chain kernel/locking/lockdep.c:3860 [inline] __lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751 down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 inode_lock_shared include/linux/fs.h:805 [inline] ext4_bmap+0x4f/0x3f0 fs/ext4/inode.c:3167 bmap+0xa2/0xd0 fs/inode.c:1828 jbd2_journal_bmap fs/jbd2/journal.c:981 [inline] jbd2_fc_get_buf+0x17b/0x350 fs/jbd2/journal.c:894 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:3003 [inline] ext4_buffered_write_iter+0x32b/0x3a0 fs/ext4/file.c:282 ext4_file_write_iter+0x73f/0x1720 fs/ext4/file.c:-1 do_iter_readv_writev+0x47d/0x5f0 fs/read_write.c:-1 do_iter_write+0x1f8/0x7a0 fs/read_write.c:855 vfs_writev fs/read_write.c:928 [inline] do_pwritev+0x241/0x3a0 fs/read_write.c:1025 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:0x7f9bb1a1c519 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:00007f9bafc69028 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007f9bb1ca8fa0 RCX: 00007f9bb1a1c519 RDX: 0000000000000001 RSI: 0000200000003b40 RDI: 0000000000000005 RBP: 00007f9bb1aac136 R08: 0000000000000000 R09: 0000000000000011 R10: 0000000000000e78 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f9bb1ca9038 R14: 00007f9bb1ca8fa0 R15: 00007ffc44c448c8 kcov: kcov_task_exit: t = ffff88807c02d940, kcov->t = ffff88807c02d940