====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.4.1333/20751 is trying to acquire lock: ffff888060926818 (sb_internal#3){.+.+}-{0:0}, at: ocfs2_duplicate_inline_data+0x16a/0x570 fs/ocfs2/refcounttree.c:3991 but task is already holding lock: ffff888060deec50 (&ocfs2_file_ip_alloc_sem_key/1){+.+.}-{4:4}, at: ocfs2_remap_file_range+0x342/0x700 fs/ocfs2/file.c:2780 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ocfs2_file_ip_alloc_sem_key/1){+.+.}-{4:4}: down_write_nested+0x39/0x50 kernel/locking/rwsem.c:1757 ocfs2_xattr_set_handle+0x3fc/0x820 fs/ocfs2/xattr.c:3941 ocfs2_init_security_set+0x151/0x210 fs/ocfs2/xattr.c:7996 ocfs2_mknod+0x13dd/0x2190 fs/ocfs2/namei.c:422 ocfs2_mkdir+0x180/0x430 fs/ocfs2/namei.c:661 vfs_mkdir+0x417/0x670 fs/namei.c:5428 filename_mkdirat+0x288/0x560 fs/namei.c:5461 __do_sys_mkdirat fs/namei.c:5482 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5479 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x16a/0x530 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&journal->j_trans_barrier){.+.+}-{4:4}: down_read+0x92/0x200 kernel/locking/rwsem.c:1574 ocfs2_start_trans+0x3aa/0x700 fs/ocfs2/journal.c:379 ocfs2_shutdown_local_alloc+0x1ef/0xa50 fs/ocfs2/localalloc.c:417 ocfs2_dismount_volume+0x1ea/0x860 fs/ocfs2/super.c:1837 generic_shutdown_super+0x140/0x2d0 fs/super.c:723 kill_block_super+0x44/0xa0 fs/super.c:1852 deactivate_locked_super+0xbe/0x110 fs/super.c:558 cleanup_mnt+0x204/0x2a0 fs/namespace.c:1396 task_work_run+0x1d9/0x260 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:70 [inline] exit_to_user_mode_loop+0x204/0x770 kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:343 [inline] do_syscall_64+0x32c/0x530 arch/x86/entry/syscall_64.c:107 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (sb_internal#3){.+.+}-{0:0}: check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs/super.h:19 [inline] sb_start_intwrite include/linux/fs/super.h:177 [inline] ocfs2_start_trans+0x2a7/0x700 fs/ocfs2/journal.c:377 ocfs2_duplicate_inline_data+0x16a/0x570 fs/ocfs2/refcounttree.c:3991 ocfs2_reflink_remap_blocks+0x4aa/0x1ab0 fs/ocfs2/refcounttree.c:4684 ocfs2_remap_file_range+0x457/0x700 fs/ocfs2/file.c:2788 vfs_copy_file_range+0xe39/0x1430 fs/read_write.c:1581 __do_sys_copy_file_range fs/read_write.c:1664 [inline] __se_sys_copy_file_range+0x2fb/0x480 fs/read_write.c:1631 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x16a/0x530 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: sb_internal#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); rlock(sb_internal#3); *** DEADLOCK *** locks held by syz.4.1333/20751: 5, on CPU#1: #0: ffff888060926528 (sb_writers#30){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2765 [inline] #0: ffff888060926528 (sb_writers#30){.+.+}-{0:0}, at: vfs_copy_file_range+0xa29/0x1430 fs/read_write.c:1569 #1: ffff888060de9c40 (&sb->s_type->i_mutex_key#38){++++}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] #1: ffff888060de9c40 (&sb->s_type->i_mutex_key#38){++++}-{4:4}, at: lock_two_nondirectories+0xe7/0x180 fs/inode.c:1275 #2: ffff888060def000 (&sb->s_type->i_mutex_key#38/4){+.+.}-{4:4}, at: ocfs2_reflink_inodes_lock+0x11a/0xc20 fs/ocfs2/refcounttree.c:4772 #3: ffff888060de9890 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_remap_file_range+0x31e/0x700 fs/ocfs2/file.c:2778 #4: ffff888060deec50 (&ocfs2_file_ip_alloc_sem_key/1){+.+.}-{4:4}, at: ocfs2_remap_file_range+0x342/0x700 fs/ocfs2/file.c:2780 stack backtrace: CPU: 1 UID: 0 PID: 20751 Comm: syz.4.1333 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2087 check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2219 check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs/super.h:19 [inline] sb_start_intwrite include/linux/fs/super.h:177 [inline] ocfs2_start_trans+0x2a7/0x700 fs/ocfs2/journal.c:377 ocfs2_duplicate_inline_data+0x16a/0x570 fs/ocfs2/refcounttree.c:3991 ocfs2_reflink_remap_blocks+0x4aa/0x1ab0 fs/ocfs2/refcounttree.c:4684 ocfs2_remap_file_range+0x457/0x700 fs/ocfs2/file.c:2788 vfs_copy_file_range+0xe39/0x1430 fs/read_write.c:1581 __do_sys_copy_file_range fs/read_write.c:1664 [inline] __se_sys_copy_file_range+0x2fb/0x480 fs/read_write.c:1631 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x16a/0x530 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fdc9bef94d9 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:00007fdc9a13e028 EFLAGS: 00000246 ORIG_RAX: 0000000000000146 RAX: ffffffffffffffda RBX: 00007fdc9c175fa0 RCX: 00007fdc9bef94d9 RDX: 0000000000000005 RSI: 0000200000004d40 RDI: 0000000000000006 RBP: 00007fdc9bf8804e R08: fffffffffffffff8 R09: 0000000000000000 R10: 0000200000007180 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fdc9c176038 R14: 00007fdc9c175fa0 R15: 00007ffe97b8f6e8