====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.2421/15804 is trying to acquire lock: ffff88805ecfd118 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:806 [inline] ffff88805ecfd118 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: vfs_rename+0x6f4/0xe60 fs/namei.c:-1 but task is already holding lock: ffff88805ecfb498 ( &sb->s_type->i_mutex_key #28/2 ){+.+.}-{3:3} , at: inode_lock_nested include/linux/fs.h:841 [inline] , at: vfs_rename+0x65e/0xe60 fs/namei.c:4902 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sb->s_type->i_mutex_key #28 /2 ){+.+.}-{3:3} : down_write_nested+0x9e/0x200 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:841 [inline] __ocfs2_reflink+0xca8/0x16e0 fs/ocfs2/refcounttree.c:4206 ocfs2_reflink+0x4e8/0x920 fs/ocfs2/refcounttree.c:4305 ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4431 ocfs2_reflink_ioctl+0x3a0/0x450 fs/ocfs2/refcounttree.c:4471 ocfs2_ioctl+0x5b9/0x7e0 fs/ocfs2/ioctl.c:923 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857 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 ( &ocfs2_file_ip_alloc_sem_key ){++++}-{3:3} : down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520 ocfs2_inode_lock_for_extent_tree+0xd6/0x190 fs/ocfs2/file.c:2234 ocfs2_prepare_inode_for_write fs/ocfs2/file.c:2290 [inline] ocfs2_file_write_iter+0x5c8/0x1e90 fs/ocfs2/file.c:2481 call_write_iter include/linux/fs.h:2021 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x474/0x9a0 fs/read_write.c:584 ksys_write+0x151/0x260 fs/read_write.c:637 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 (&sb->s_type->i_mutex_key#28){+.+.}-{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] vfs_rename+0x6f4/0xe60 fs/namei.c:-1 do_renameat2+0x8b0/0xc80 fs/namei.c:5092 __do_sys_rename fs/namei.c:5138 [inline] __se_sys_rename fs/namei.c:5136 [inline] __x64_sys_rename+0x86/0x90 fs/namei.c:5136 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: &sb->s_type->i_mutex_key#28 --> &ocfs2_file_ip_alloc_sem_key --> &sb->s_type->i_mutex_key#28/2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#28/2); lock(&ocfs2_file_ip_alloc_sem_key); lock(&sb->s_type->i_mutex_key#28/2); lock(&sb->s_type->i_mutex_key#28); *** DEADLOCK *** 5 locks held by syz.0.2421/15804: #0: ffff888027d7e418 (sb_writers#21){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412 #1: ffff888027d7e700 (&type->s_vfs_rename_key#3){+.+.}-{3:3}, at: lock_rename fs/namei.c:3105 [inline] #1: ffff888027d7e700 (&type->s_vfs_rename_key#3){+.+.}-{3:3}, at: do_renameat2+0x36e/0xc80 fs/namei.c:5031 #2: ffff88804d471818 (&type->i_mutex_dir_key#14/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:841 [inline] #2: ffff88804d471818 (&type->i_mutex_dir_key#14/1){+.+.}-{3:3}, at: lock_two_directories fs/namei.c:-1 [inline] #2: ffff88804d471818 (&type->i_mutex_dir_key#14/1){+.+.}-{3:3}, at: lock_rename fs/namei.c:3106 [inline] #2: ffff88804d471818 (&type->i_mutex_dir_key#14/1){+.+.}-{3:3}, at: do_renameat2+0x405/0xc80 fs/namei.c:5031 #3: ffff88805ecfc2d8 (&sb->s_type->i_mutex_key#28/5){+.+.}-{3:3}, at: lock_rename include/linux/fs.h:-1 [inline] #3: ffff88805ecfc2d8 (&sb->s_type->i_mutex_key#28/5){+.+.}-{3:3}, at: do_renameat2+0x440/0xc80 fs/namei.c:5031 #4: ffff88805ecfb498 (&sb->s_type->i_mutex_key#28/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:841 [inline] #4: ffff88805ecfb498 (&sb->s_type->i_mutex_key#28/2){+.+.}-{3:3}, at: vfs_rename+0x65e/0xe60 fs/namei.c:4902 stack backtrace: CPU: 0 PID: 15804 Comm: syz.0.2421 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] vfs_rename+0x6f4/0xe60 fs/namei.c:-1 do_renameat2+0x8b0/0xc80 fs/namei.c:5092 __do_sys_rename fs/namei.c:5138 [inline] __se_sys_rename fs/namei.c:5136 [inline] __x64_sys_rename+0x86/0x90 fs/namei.c:5136 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:0x7f8fcc7a9b59 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:00007f8fcd688028 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007f8fcca35fa0 RCX: 00007f8fcc7a9b59 RDX: 0000000000000000 RSI: 0000200000000b80 RDI: 0000200000000b40 RBP: 00007f8fcc83a18b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f8fcca36038 R14: 00007f8fcca35fa0 R15: 00007ffeb9390b18 (syz.0.2421,15804,1):ocfs2_rename:1693 ERROR: status = -39