ocfs2: Mounting device (7,8) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Tainted: G L ------------------------------------------------------ syz.8.1086/9351 is trying to acquire lock: ffff88805114dda0 (&sb->s_type->i_mutex_key#38){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] ffff88805114dda0 (&sb->s_type->i_mutex_key#38){+.+.}-{4:4}, at: vfs_rename+0x6e3/0xef0 fs/namei.c:-1 but task is already holding lock: ffff88805114cfa0 (&sb->s_type->i_mutex_key#38/2){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1072 [inline] ffff88805114cfa0 (&sb->s_type->i_mutex_key#38/2){+.+.}-{4:4}, at: vfs_rename+0x64d/0xef0 fs/namei.c:6178 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&sb->s_type->i_mutex_key#38/2){+.+.}-{4:4}: down_write_nested+0x98/0x200 kernel/locking/rwsem.c:1757 inode_lock_nested include/linux/fs.h:1072 [inline] __ocfs2_reflink+0xcab/0x16e0 fs/ocfs2/refcounttree.c:4228 ocfs2_reflink+0x4eb/0x920 fs/ocfs2/refcounttree.c:4327 ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4453 ocfs2_reflink_ioctl+0x3a0/0x450 fs/ocfs2/refcounttree.c:4493 ocfs2_ioctl+0x5b5/0x7e0 fs/ocfs2/ioctl.c:920 vfs_ioctl fs/ioctl.c:52 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}: down_write+0x91/0x200 kernel/locking/rwsem.c:1631 ocfs2_reflink+0x4d2/0x920 fs/ocfs2/refcounttree.c:4326 ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4453 ocfs2_reflink_ioctl+0x3a0/0x450 fs/ocfs2/refcounttree.c:4493 ocfs2_ioctl+0x5b5/0x7e0 fs/ocfs2/ioctl.c:920 vfs_ioctl fs/ioctl.c:52 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&oi->ip_xattr_sem){++++}-{4:4}: down_write+0x91/0x200 kernel/locking/rwsem.c:1631 ocfs2_reflink+0x4c3/0x920 fs/ocfs2/refcounttree.c:4325 ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4453 ocfs2_reflink_ioctl+0x3a0/0x450 fs/ocfs2/refcounttree.c:4493 ocfs2_ioctl+0x5b5/0x7e0 fs/ocfs2/ioctl.c:920 vfs_ioctl fs/ioctl.c:52 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&sb->s_type->i_mutex_key#38){+.+.}-{4:4}: 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 down_write+0x91/0x200 kernel/locking/rwsem.c:1631 inode_lock include/linux/fs.h:1027 [inline] vfs_rename+0x6e3/0xef0 fs/namei.c:-1 filename_renameat2+0x54e/0x9f0 fs/namei.c:6344 __do_sys_rename fs/namei.c:6388 [inline] __se_sys_rename+0x55/0x2c0 fs/namei.c:6384 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 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->s_type->i_mutex_key#38 --> &ocfs2_file_ip_alloc_sem_key --> &sb->s_type->i_mutex_key#38/2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#38/2); lock(&ocfs2_file_ip_alloc_sem_key); lock(&sb->s_type->i_mutex_key#38/2); lock(&sb->s_type->i_mutex_key#38); *** DEADLOCK *** locks held by syz.8.1086/9351: 5, on CPU#0: #0: ffff88804a704478 (sb_writers#18){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:531 #1: ffff88804a704780 (&type->s_vfs_rename_key#3){+.+.}-{4:4}, at: lock_rename fs/namei.c:3795 [inline] #1: ffff88804a704780 (&type->s_vfs_rename_key#3){+.+.}-{4:4}, at: __start_renaming+0xed/0x410 fs/namei.c:3884 #2: ffff88805342eba0 (&type->i_mutex_dir_key#13/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1072 [inline] #2: ffff88805342eba0 (&type->i_mutex_dir_key#13/1){+.+.}-{4:4}, at: lock_two_directories+0x141/0x220 fs/namei.c:3761 #3: ffff88805114eba0 (&sb->s_type->i_mutex_key#38/5){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1072 [inline] #3: ffff88805114eba0 (&sb->s_type->i_mutex_key#38/5){+.+.}-{4:4}, at: lock_two_directories+0x16b/0x220 fs/namei.c:3762 #4: ffff88805114cfa0 (&sb->s_type->i_mutex_key#38/2){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1072 [inline] #4: ffff88805114cfa0 (&sb->s_type->i_mutex_key#38/2){+.+.}-{4:4}, at: vfs_rename+0x64d/0xef0 fs/namei.c:6178 stack backtrace: CPU: 0 UID: 0 PID: 9351 Comm: syz.8.1086 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP 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 down_write+0x91/0x200 kernel/locking/rwsem.c:1631 inode_lock include/linux/fs.h:1027 [inline] vfs_rename+0x6e3/0xef0 fs/namei.c:-1 filename_renameat2+0x54e/0x9f0 fs/namei.c:6344 __do_sys_rename fs/namei.c:6388 [inline] __se_sys_rename+0x55/0x2c0 fs/namei.c:6384 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff7e73a9559 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:00007ff7e828f028 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007ff7e7625fa0 RCX: 00007ff7e73a9559 RDX: 0000000000000000 RSI: 0000200000000b80 RDI: 0000200000000b40 RBP: 00007ff7e7438136 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ff7e7626038 R14: 00007ff7e7625fa0 R15: 00007ffe1b264a18 (syz.8.1086,9351,0):ocfs2_rename:1290 ERROR: status = -2 (syz.8.1086,9351,0):ocfs2_rename:1705 ERROR: status = -2