====================================================== WARNING: possible circular locking dependency detected 6.16.0-rc5-next-20250711-syzkaller #0 Not tainted ------------------------------------------------------ syz.3.643/9572 is trying to acquire lock: ffff888053093ff8 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_calc_xattr_init+0x20a/0xd80 fs/ocfs2/xattr.c:627 but task is already holding lock: ffff88805b601800 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] ffff88805b601800 (&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:1592 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+0x504/0x9c0 fs/inode.c:810 d_delete_notify include/linux/fsnotify.h:377 [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:1592 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+0x258/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_pwritev fs/read_write.c:1153 [inline] __do_sys_pwritev2 fs/read_write.c:1211 [inline] __se_sys_pwritev2+0x179/0x290 fs/read_write.c:1202 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:1592 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+0xb33/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:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_open fs/open.c:1458 [inline] __se_sys_open fs/open.c:1454 [inline] __x64_sys_open+0x11e/0x150 fs/open.c:1454 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:1539 ocfs2_calc_xattr_init+0x20a/0xd80 fs/ocfs2/xattr.c:627 ocfs2_mknod+0xc92/0x2050 fs/ocfs2/namei.c:333 ocfs2_create+0x1a5/0x440 fs/ocfs2/namei.c:676 lookup_open fs/namei.c:3708 [inline] open_last_lookups fs/namei.c:3807 [inline] path_openat+0x14f1/0x3830 fs/namei.c:4043 do_filp_open+0x1fa/0x410 fs/namei.c:4073 do_sys_openat2+0x121/0x1c0 fs/open.c:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_open fs/open.c:1458 [inline] __se_sys_open fs/open.c:1454 [inline] __x64_sys_open+0x11e/0x150 fs/open.c:1454 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.3.643/9572: #0: ffff888024c50428 (sb_writers#18){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:557 #1: ffff8880530942c0 (&type->i_mutex_dir_key#11){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #1: ffff8880530942c0 (&type->i_mutex_dir_key#11){++++}-{4:4}, at: open_last_lookups fs/namei.c:3804 [inline] #1: ffff8880530942c0 (&type->i_mutex_dir_key#11){++++}-{4:4}, at: path_openat+0x8da/0x3830 fs/namei.c:4043 #2: ffff88805b601800 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #2: ffff88805b601800 (&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: 9572 Comm: syz.3.643 Not tainted 6.16.0-rc5-next-20250711-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:1539 ocfs2_calc_xattr_init+0x20a/0xd80 fs/ocfs2/xattr.c:627 ocfs2_mknod+0xc92/0x2050 fs/ocfs2/namei.c:333 ocfs2_create+0x1a5/0x440 fs/ocfs2/namei.c:676 lookup_open fs/namei.c:3708 [inline] open_last_lookups fs/namei.c:3807 [inline] path_openat+0x14f1/0x3830 fs/namei.c:4043 do_filp_open+0x1fa/0x410 fs/namei.c:4073 do_sys_openat2+0x121/0x1c0 fs/open.c:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_open fs/open.c:1458 [inline] __se_sys_open fs/open.c:1454 [inline] __x64_sys_open+0x11e/0x150 fs/open.c:1454 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:0x7f872358e929 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:00007f8724377038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f87237b6080 RCX: 00007f872358e929 RDX: 00000000000000e1 RSI: 000000000014927e RDI: 00002000000001c0 RBP: 00007f8723610b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f87237b6080 R15: 00007ffd71ae3f88