RBP: 00007f04bb410b39 R08: 0000000000000200 R09: 0000000000000000 R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f04bb5b5fa0 R15: 00007ffdc1e68028 ====================================================== WARNING: possible circular locking dependency detected 6.16.0-rc4-next-20250704-syzkaller #0 Not tainted ------------------------------------------------------ syz.7.1304/12736 is trying to acquire lock: ffff888057e6a378 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_calc_xattr_init+0x20a/0xd80 fs/ocfs2/xattr.c:627 but task is already holding lock: ffff88807a679800 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff88807a679800 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x15e/0x4640 fs/ocfs2/suballoc.c:788 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871 down_write+0x96/0x1f0 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:869 [inline] ocfs2_remove_inode fs/ocfs2/inode.c:731 [inline] ocfs2_wipe_inode fs/ocfs2/inode.c:894 [inline] ocfs2_delete_inode fs/ocfs2/inode.c:1155 [inline] ocfs2_evict_inode+0x153d/0x40e0 fs/ocfs2/inode.c:1292 evict+0x501/0x9c0 fs/inode.c:810 d_delete_notify include/linux/fsnotify.h:402 [inline] vfs_rmdir+0x3ec/0x520 fs/namei.c:4474 do_rmdir+0x25f/0x550 fs/namei.c:4516 __do_sys_rmdir fs/namei.c:4535 [inline] __se_sys_rmdir fs/namei.c:4533 [inline] __x64_sys_rmdir+0x47/0x50 fs/namei.c:4533 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE]){+.+.}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871 down_write+0x96/0x1f0 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:869 [inline] ocfs2_del_inode_from_orphan+0x134/0x740 fs/ocfs2/namei.c:2730 ocfs2_dio_end_io_write fs/ocfs2/aops.c:2304 [inline] ocfs2_dio_end_io+0x479/0x10f0 fs/ocfs2/aops.c:2402 dio_complete+0x25b/0x790 fs/direct-io.c:281 __blockdev_direct_IO+0x2e63/0x3490 fs/direct-io.c:1303 ocfs2_direct_IO+0x25f/0x2d0 fs/ocfs2/aops.c:2439 generic_file_direct_write+0x1db/0x3e0 mm/filemap.c:4109 __generic_file_write_iter+0x11d/0x230 mm/filemap.c:4278 ocfs2_file_write_iter+0x157a/0x1d10 fs/ocfs2/file.c:2469 do_iter_readv_writev+0x56b/0x7f0 fs/read_write.c:-1 vfs_writev+0x31a/0x960 fs/read_write.c:1057 do_writev+0x14d/0x2d0 fs/read_write.c:1103 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&oi->ip_alloc_sem){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871 down_write+0x96/0x1f0 kernel/locking/rwsem.c:1577 ocfs2_try_remove_refcount_tree+0xb6/0x320 fs/ocfs2/refcounttree.c:932 ocfs2_truncate_file+0xda0/0x1420 fs/ocfs2/file.c:521 ocfs2_setattr+0x1520/0x1b40 fs/ocfs2/file.c:1212 notify_change+0xb36/0xe40 fs/attr.c:552 do_truncate+0x1a4/0x220 fs/open.c:68 handle_truncate fs/namei.c:3508 [inline] do_open fs/namei.c:3891 [inline] path_openat+0x306c/0x3830 fs/namei.c:4046 do_filp_open+0x1fa/0x410 fs/namei.c:4073 do_sys_openat2+0x121/0x1c0 fs/open.c:1434 do_sys_open fs/open.c:1449 [inline] __do_sys_open fs/open.c:1457 [inline] __se_sys_open fs/open.c:1453 [inline] __x64_sys_open+0x11e/0x150 fs/open.c:1453 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&oi->ip_xattr_sem){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3168 [inline] check_prevs_add kernel/locking/lockdep.c:3287 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3911 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5240 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871 down_read+0x46/0x2e0 kernel/locking/rwsem.c:1524 ocfs2_calc_xattr_init+0x20a/0xd80 fs/ocfs2/xattr.c:627 ocfs2_mknod+0xc92/0x2050 fs/ocfs2/namei.c:333 ocfs2_mkdir+0x191/0x440 fs/ocfs2/namei.c:659 vfs_mkdir+0x303/0x510 fs/namei.c:4366 do_mkdirat+0x247/0x590 fs/namei.c:4399 __do_sys_mkdir fs/namei.c:4421 [inline] __se_sys_mkdir fs/namei.c:4419 [inline] __x64_sys_mkdir+0x6c/0x80 fs/namei.c:4419 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &oi->ip_xattr_sem --> &ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE] --> &ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE] Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]); lock(&ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE]); lock(&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]); rlock(&oi->ip_xattr_sem); *** DEADLOCK *** 3 locks held by syz.7.1304/12736: #0: ffff8880322b4428 (sb_writers#17){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:557 #1: ffff888057e6a640 (&type->i_mutex_dir_key#13/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:914 [inline] #1: ffff888057e6a640 (&type->i_mutex_dir_key#13/1){+.+.}-{4:4}, at: filename_create+0x1f8/0x3c0 fs/namei.c:4139 #2: ffff88807a679800 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #2: ffff88807a679800 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x15e/0x4640 fs/ocfs2/suballoc.c:788 stack backtrace: CPU: 0 UID: 0 PID: 12736 Comm: syz.7.1304 Not tainted 6.16.0-rc4-next-20250704-syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_circular_bug+0x2ee/0x310 kernel/locking/lockdep.c:2046 check_noncircular+0x134/0x160 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3168 [inline] check_prevs_add kernel/locking/lockdep.c:3287 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3911 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5240 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871 down_read+0x46/0x2e0 kernel/locking/rwsem.c:1524 ocfs2_calc_xattr_init+0x20a/0xd80 fs/ocfs2/xattr.c:627 ocfs2_mknod+0xc92/0x2050 fs/ocfs2/namei.c:333 ocfs2_mkdir+0x191/0x440 fs/ocfs2/namei.c:659 vfs_mkdir+0x303/0x510 fs/namei.c:4366 do_mkdirat+0x247/0x590 fs/namei.c:4399 __do_sys_mkdir fs/namei.c:4421 [inline] __se_sys_mkdir fs/namei.c:4419 [inline] __x64_sys_mkdir+0x6c/0x80 fs/namei.c:4419 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f04bb38e929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f04bc118038 EFLAGS: 00000246 ORIG_RAX: 0000000000000053 RAX: ffffffffffffffda RBX: 00007f04bb5b5fa0 RCX: 00007f04bb38e929 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 0000200000000000 RBP: 00007f04bb410b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f04bb5b5fa0 R15: 00007ffdc1e68028