====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.4.286/7476 is trying to acquire lock: ffff88805a696d98 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:806 [inline] ffff88805a696d98 (&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: ffff8880530c8660 (&oi->ip_alloc_sem/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 (&oi->ip_alloc_sem/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+0x1fb/0x420 fs/ocfs2/acl.c:427 ocfs2_mknod+0x1373/0x2250 fs/ocfs2/namei.c:409 ocfs2_mkdir+0x196/0x430 fs/ocfs2/namei.c:658 vfs_mkdir+0x2a5/0x470 fs/namei.c:4180 do_mkdirat+0x1dc/0x450 fs/namei.c:4203 __do_sys_mkdirat fs/namei.c:4218 [inline] __se_sys_mkdirat fs/namei.c:4216 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4216 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_mkdir+0x196/0x430 fs/ocfs2/namei.c:658 vfs_mkdir+0x2a5/0x470 fs/namei.c:4180 do_mkdirat+0x1dc/0x450 fs/namei.c:4203 __do_sys_mkdirat fs/namei.c:4218 [inline] __se_sys_mkdirat fs/namei.c:4216 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4216 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_xattr_set+0xf58/0x13f0 fs/ocfs2/xattr.c:3990 ocfs2_set_acl+0x4d4/0x580 fs/ocfs2/acl.c:253 ocfs2_iop_set_acl+0x1b2/0x2b0 fs/ocfs2/acl.c:285 set_posix_acl fs/posix_acl.c:963 [inline] vfs_set_acl+0x80f/0xa70 fs/posix_acl.c:1142 do_set_acl+0xf5/0x180 fs/posix_acl.c:1287 do_setxattr fs/xattr.c:627 [inline] path_setxattr+0x362/0x590 fs/xattr.c:659 __do_sys_setxattr fs/xattr.c:677 [inline] __se_sys_setxattr fs/xattr.c:673 [inline] __x64_sys_setxattr+0xbb/0xd0 fs/xattr.c:673 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 --> &oi->ip_alloc_sem/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&oi->ip_alloc_sem/1); lock(&journal->j_trans_barrier); lock(&oi->ip_alloc_sem/1); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3); *** DEADLOCK *** 5 locks held by syz.4.286/7476: #0: ffff88807c284418 (sb_writers#21){.+.+}-{0:0}, at: vfs_copy_file_range+0x8d5/0x15a0 fs/read_write.c:1503 #1: ffff8880530c89d8 (&sb->s_type->i_mutex_key#33){++++}-{3:3}, at: inode_lock_nested include/linux/fs.h:841 [inline] #1: ffff8880530c89d8 (&sb->s_type->i_mutex_key#33){++++}-{3:3}, at: lock_two_inodes fs/inode.c:1180 [inline] #1: ffff8880530c89d8 (&sb->s_type->i_mutex_key#33){++++}-{3:3}, at: lock_two_nondirectories+0x1ab/0x270 fs/inode.c:1200 #2: ffff8880530c9818 (&sb->s_type->i_mutex_key#33/4){+.+.}-{3:3}, at: ocfs2_reflink_inodes_lock+0x11a/0xbb0 fs/ocfs2/refcounttree.c:4750 #3: ffff8880530c94a0 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_remap_file_range+0x3de/0x740 fs/ocfs2/file.c:2765 #4: ffff8880530c8660 (&oi->ip_alloc_sem/1){+.+.}-{3:3}, at: ocfs2_remap_file_range+0x3fa/0x740 fs/ocfs2/file.c:2767 stack backtrace: CPU: 1 PID: 7476 Comm: syz.4.286 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:0x7f31c15a9c99 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:00007f31c2415028 EFLAGS: 00000246 ORIG_RAX: 0000000000000146 RAX: ffffffffffffffda RBX: 00007f31c1836098 RCX: 00007f31c15a9c99 RDX: 0000000000000004 RSI: 0000200000004840 RDI: 0000000000000005 RBP: 00007f31c163b18b R08: 00000000a003e458 R09: 0700000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f31c1836130 R14: 00007f31c1836098 R15: 00007fff972336f8