====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Tainted: G L ------------------------------------------------------ syz.8.4878/20827 is trying to acquire lock: ffff888053d733a0 (&sb->s_type->i_mutex_key#35){++++}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline] ffff888053d733a0 (&sb->s_type->i_mutex_key#35){++++}-{4:4}, at: vfs_rename+0x6e3/0xef0 fs/namei.c:-1 but task is already holding lock: ffff888053d741a0 (&sb->s_type->i_mutex_key#35/2){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1069 [inline] ffff888053d741a0 (&sb->s_type->i_mutex_key#35/2){+.+.}-{4:4}, at: vfs_rename+0x64d/0xef0 fs/namei.c:6159 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sb->s_type->i_mutex_key#35/2){+.+.}-{4:4}: down_write_nested+0x9d/0x210 kernel/locking/rwsem.c:1757 inode_lock_nested include/linux/fs.h:1069 [inline] __ocfs2_reflink+0xcab/0x16e0 fs/ocfs2/refcounttree.c:4198 ocfs2_reflink+0x4eb/0x920 fs/ocfs2/refcounttree.c:4297 ocfs2_vfs_reflink+0x338/0x450 fs/ocfs2/refcounttree.c:4423 ocfs2_reflink_ioctl+0x3a0/0x450 fs/ocfs2/refcounttree.c:4463 ocfs2_ioctl+0x5b5/0x7e0 fs/ocfs2/ioctl.c:920 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&ocfs2_quota_ip_alloc_sem_key){++++}-{4:4}: down_read+0x4a/0x330 kernel/locking/rwsem.c:1574 ocfs2_inode_lock_for_extent_tree+0xd6/0x190 fs/ocfs2/file.c:2222 ocfs2_prepare_inode_for_write fs/ocfs2/file.c:2278 [inline] ocfs2_file_write_iter+0x6d5/0x1f10 fs/ocfs2/file.c:2463 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&sb->s_type->i_mutex_key#35){++++}-{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+0x96/0x200 kernel/locking/rwsem.c:1631 inode_lock include/linux/fs.h:1024 [inline] vfs_rename+0x6e3/0xef0 fs/namei.c:-1 filename_renameat2+0x533/0x9a0 fs/namei.c:6325 __do_sys_rename fs/namei.c:6369 [inline] __se_sys_rename+0x55/0x2c0 fs/namei.c:6365 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#35 --> &ocfs2_quota_ip_alloc_sem_key --> &sb->s_type->i_mutex_key#35/2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#35/2); lock(&ocfs2_quota_ip_alloc_sem_key); lock(&sb->s_type->i_mutex_key#35/2); lock(&sb->s_type->i_mutex_key#35); *** DEADLOCK *** locks held by syz.8.4878/20827: 5, last CPU#1: #0: ffff88803b036460 (sb_writers#19){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:531 #1: ffff88803b036768 (&type->s_vfs_rename_key#6){+.+.}-{4:4}, at: lock_rename fs/namei.c:3789 [inline] #1: ffff88803b036768 (&type->s_vfs_rename_key#6){+.+.}-{4:4}, at: __start_renaming+0xed/0x410 fs/namei.c:3878 #2: ffff8880363a33a0 (&type->i_mutex_dir_key#13/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1069 [inline] #2: ffff8880363a33a0 (&type->i_mutex_dir_key#13/1){+.+.}-{4:4}, at: lock_two_directories+0x141/0x220 fs/namei.c:3755 #3: ffff8880363a6ba0 (&sb->s_type->i_mutex_key#35/5){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1069 [inline] #3: ffff8880363a6ba0 (&sb->s_type->i_mutex_key#35/5){+.+.}-{4:4}, at: lock_two_directories+0x16b/0x220 fs/namei.c:3756 #4: ffff888053d741a0 (&sb->s_type->i_mutex_key#35/2){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1069 [inline] #4: ffff888053d741a0 (&sb->s_type->i_mutex_key#35/2){+.+.}-{4:4}, at: vfs_rename+0x64d/0xef0 fs/namei.c:6159 stack backtrace: CPU: 1 UID: 0 PID: 20827 Comm: syz.8.4878 Tainted: G L syzkaller #0 PREEMPT(lazy) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/05/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+0x96/0x200 kernel/locking/rwsem.c:1631 inode_lock include/linux/fs.h:1024 [inline] vfs_rename+0x6e3/0xef0 fs/namei.c:-1 filename_renameat2+0x533/0x9a0 fs/namei.c:6325 __do_sys_rename fs/namei.c:6369 [inline] __se_sys_rename+0x55/0x2c0 fs/namei.c:6365 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2abdf9e559 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:00007f2abed8c028 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007f2abe225fa0 RCX: 00007f2abdf9e559 RDX: 0000000000000000 RSI: 0000200000002bc0 RDI: 0000200000002b80 RBP: 00007f2abe035ad8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f2abe226038 R14: 00007f2abe225fa0 R15: 00007ffe0e831ca8