====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.3.1622/14857 is trying to acquire lock: ffff888057466d98 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:806 [inline] ffff888057466d98 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x171/0x44a0 fs/ocfs2/suballoc.c:804 but task is already holding lock: ffff88805742cda0 (&ocfs2_file_ip_alloc_sem_key/1){+.+.}-{3:3}, at: ocfs2_remap_file_range+0x3fa/0x740 fs/ocfs2/file.c:2767 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&ocfs2_file_ip_alloc_sem_key/1){+.+.}-{3:3}: down_write_nested+0x9e/0x200 kernel/locking/rwsem.c:1689 ocfs2_xattr_set_handle+0x3fd/0x820 fs/ocfs2/xattr.c:3839 ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249 ocfs2_init_acl+0x3bb/0x420 fs/ocfs2/acl.c:444 ocfs2_mknod+0x1373/0x2250 fs/ocfs2/namei.c:409 ocfs2_create+0x196/0x430 fs/ocfs2/namei.c:675 lookup_open fs/namei.c:3551 [inline] open_last_lookups fs/namei.c:3619 [inline] path_openat+0x1705/0x3270 fs/namei.c:3853 do_filp_open+0x1f2/0x430 fs/namei.c:3883 do_sys_openat2+0x134/0x1d0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x139/0x160 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #2 (&journal->j_trans_barrier){.+.+}-{3:3}: down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520 ocfs2_start_trans+0x3a8/0x6f0 fs/ocfs2/journal.c:382 ocfs2_mknod+0xef1/0x2250 fs/ocfs2/namei.c:360 ocfs2_create+0x196/0x430 fs/ocfs2/namei.c:675 lookup_open fs/namei.c:3551 [inline] open_last_lookups fs/namei.c:3619 [inline] path_openat+0x1705/0x3270 fs/namei.c:3853 do_filp_open+0x1f2/0x430 fs/namei.c:3883 do_sys_openat2+0x134/0x1d0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x139/0x160 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (sb_internal#4){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1636 [inline] sb_start_intwrite include/linux/fs.h:1758 [inline] ocfs2_start_trans+0x2a9/0x6f0 fs/ocfs2/journal.c:380 ocfs2_create_refcount_tree+0x33f/0x11e0 fs/ocfs2/refcounttree.c:606 ocfs2_reflink_remap_blocks+0x317/0x1ab0 fs/ocfs2/refcounttree.c:4683 ocfs2_remap_file_range+0x4b1/0x740 fs/ocfs2/file.c:2775 do_clone_file_range+0x282/0x2f0 fs/remap_range.c:396 vfs_clone_file_range+0x1f3/0x4f0 fs/remap_range.c:414 ioctl_file_clone fs/ioctl.c:240 [inline] ioctl_file_clone_range fs/ioctl.c:259 [inline] do_vfs_ioctl+0xfdb/0x1cc0 fs/ioctl.c:824 __do_sys_ioctl fs/ioctl.c:869 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790 down_write+0x97/0x200 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:806 [inline] ocfs2_reserve_suballoc_bits+0x171/0x44a0 fs/ocfs2/suballoc.c:804 ocfs2_reserve_new_metadata_blocks+0x416/0x9a0 fs/ocfs2/suballoc.c:1000 ocfs2_create_refcount_tree+0x270/0x11e0 fs/ocfs2/refcounttree.c:600 ocfs2_reflink_remap_blocks+0x317/0x1ab0 fs/ocfs2/refcounttree.c:4683 ocfs2_remap_file_range+0x4b1/0x740 fs/ocfs2/file.c:2775 vfs_copy_file_range+0xdc9/0x15a0 fs/read_write.c:1519 __do_sys_copy_file_range fs/read_write.c:1597 [inline] __se_sys_copy_file_range+0x324/0x470 fs/read_write.c:1560 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3 --> &journal->j_trans_barrier --> &ocfs2_file_ip_alloc_sem_key/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ocfs2_file_ip_alloc_sem_key/1); lock(&journal->j_trans_barrier); lock(&ocfs2_file_ip_alloc_sem_key/1); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3); *** DEADLOCK *** 5 locks held by syz.3.1622/14857: #0: ffff88807b57a418 (sb_writers#15){.+.+}-{0:0}, at: vfs_copy_file_range+0x8d5/0x15a0 fs/read_write.c:1503 #1: ffff88805742d118 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:841 [inline] #1: ffff88805742d118 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: lock_two_inodes fs/inode.c:1180 [inline] #1: ffff88805742d118 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: lock_two_nondirectories+0x1ab/0x270 fs/inode.c:1200 #2: ffff88805dd7c2d8 (&sb->s_type->i_mutex_key#22/4){+.+.}-{3:3}, at: ocfs2_reflink_inodes_lock+0x11a/0xbb0 fs/ocfs2/refcounttree.c:4750 #3: ffff88805dd7bf60 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_remap_file_range+0x3de/0x740 fs/ocfs2/file.c:2765 #4: ffff88805742cda0 (&ocfs2_file_ip_alloc_sem_key/1){+.+.}-{3:3}, at: ocfs2_remap_file_range+0x3fa/0x740 fs/ocfs2/file.c:2767 stack backtrace: CPU: 1 PID: 14857 Comm: syz.3.1622 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2215 check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790 down_write+0x97/0x200 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:806 [inline] ocfs2_reserve_suballoc_bits+0x171/0x44a0 fs/ocfs2/suballoc.c:804 ocfs2_reserve_new_metadata_blocks+0x416/0x9a0 fs/ocfs2/suballoc.c:1000 ocfs2_create_refcount_tree+0x270/0x11e0 fs/ocfs2/refcounttree.c:600 ocfs2_reflink_remap_blocks+0x317/0x1ab0 fs/ocfs2/refcounttree.c:4683 ocfs2_remap_file_range+0x4b1/0x740 fs/ocfs2/file.c:2775 vfs_copy_file_range+0xdc9/0x15a0 fs/read_write.c:1519 __do_sys_copy_file_range fs/read_write.c:1597 [inline] __se_sys_copy_file_range+0x324/0x470 fs/read_write.c:1560 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fcf21da9c99 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:00007fcf22baa028 EFLAGS: 00000246 ORIG_RAX: 0000000000000146 RAX: ffffffffffffffda RBX: 00007fcf22036098 RCX: 00007fcf21da9c99 RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000006 RBP: 00007fcf21e3b18b R08: ffffffffa003e45c R09: 0700000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fcf22036130 R14: 00007fcf22036098 R15: 00007fff986e4e28 kcov: kcov_task_exit: t = ffff888025be9e00, kcov->t = ffff888025be9e00