====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.5.625/6941 is trying to acquire lock: ffff0000f5edd108 (&sb->s_type->i_mutex_key#29/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] ffff0000f5edd108 (&sb->s_type->i_mutex_key#29/2){+.+.}-{3:3}, at: __ocfs2_reflink+0x9c0/0x136c fs/ocfs2/refcounttree.c:4178 but task is already holding lock: ffff0000f5eddbe0 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_reflink+0x484/0x84c fs/ocfs2/refcounttree.c:4276 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}: down_read+0x64/0x300 kernel/locking/rwsem.c:1520 ocfs2_inode_lock_for_extent_tree+0xec/0x268 fs/ocfs2/file.c:2210 ocfs2_prepare_inode_for_write fs/ocfs2/file.c:2266 [inline] ocfs2_file_write_iter+0x5bc/0x1cd0 fs/ocfs2/file.c:2451 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x3c8/0x7c8 fs/read_write.c:584 ksys_write+0x12c/0x228 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:646 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #1 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}: down_write+0x5c/0x88 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] vfs_rename+0x6a8/0xe3c fs/namei.c:4847 do_renameat2+0x760/0xaa4 fs/namei.c:5035 __do_sys_renameat2 fs/namei.c:5068 [inline] __se_sys_renameat2 fs/namei.c:5065 [inline] __arm64_sys_renameat2+0xe8/0x104 fs/namei.c:5065 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #0 (&sb->s_type->i_mutex_key#29/2){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063 lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5676 down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] __ocfs2_reflink+0x9c0/0x136c fs/ocfs2/refcounttree.c:4178 ocfs2_reflink+0x498/0x84c fs/ocfs2/refcounttree.c:4277 ocfs2_vfs_reflink+0x300/0x400 fs/ocfs2/refcounttree.c:4403 ocfs2_reflink_ioctl+0x35c/0x3f0 fs/ocfs2/refcounttree.c:4443 ocfs2_ioctl+0x884/0xb2c fs/ocfs2/ioctl.c:913 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#29/2 --> &sb->s_type->i_mutex_key#29 --> &ocfs2_file_ip_alloc_sem_key Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ocfs2_file_ip_alloc_sem_key); lock(&sb->s_type->i_mutex_key#29); lock(&ocfs2_file_ip_alloc_sem_key); lock(&sb->s_type->i_mutex_key#29/2); *** DEADLOCK *** 5 locks held by syz.5.625/6941: #0: ffff0000d9dd2460 (sb_writers#26){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:402 #1: ffff0000e16db488 (&type->i_mutex_dir_key#15/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #1: ffff0000e16db488 (&type->i_mutex_dir_key#15/1){+.+.}-{3:3}, at: filename_create+0x1b0/0x3a8 fs/namei.c:3884 #2: ffff0000f5eddf48 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #2: ffff0000f5eddf48 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}, at: ocfs2_vfs_reflink+0x2bc/0x400 fs/ocfs2/refcounttree.c:4400 #3: ffff0000f5eddc78 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_reflink+0x47c/0x84c fs/ocfs2/refcounttree.c:4275 #4: ffff0000f5eddbe0 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_reflink+0x484/0x84c fs/ocfs2/refcounttree.c:4276 stack backtrace: CPU: 1 PID: 6941 Comm: syz.5.625 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2048 check_noncircular+0x264/0x2f8 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063 lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5676 down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] __ocfs2_reflink+0x9c0/0x136c fs/ocfs2/refcounttree.c:4178 ocfs2_reflink+0x498/0x84c fs/ocfs2/refcounttree.c:4277 ocfs2_vfs_reflink+0x300/0x400 fs/ocfs2/refcounttree.c:4403 ocfs2_reflink_ioctl+0x35c/0x3f0 fs/ocfs2/refcounttree.c:4443 ocfs2_ioctl+0x884/0xb2c fs/ocfs2/ioctl.c:913 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 (syz.5.625,6941,1):ocfs2_check_dir_entry:325 ERROR: bad entry in directory #72: rec_len is smaller than minimal - offset=0, inode=1099511627848, rec_len=12, name_len=0 (syz.5.625,6941,1):__ocfs2_delete_entry:1162 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_orphan_del:2386 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_orphan_del:2401 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_mv_orphaned_inode_to_new:2860 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_mv_orphaned_inode_to_new:2906 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_reflink:4310 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_check_dir_entry:325 ERROR: bad entry in directory #72: rec_len is smaller than minimal - offset=0, inode=1099511627848, rec_len=12, name_len=0 (syz.5.625,6941,1):__ocfs2_delete_entry:1162 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_orphan_del:2386 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_orphan_del:2401 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_remove_inode:709 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_wipe_inode:854 ERROR: status = -5 (syz.5.625,6941,1):ocfs2_delete_inode:1115 ERROR: status = -5