ocfs2: Mounting device (7,1) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected 6.11.0-syzkaller-02574-ga430d95c5efa #0 Not tainted ------------------------------------------------------ syz.1.8/5340 is trying to acquire lock: ffff8880212915a8 (&osb->system_file_mutex){+.+.}-{3:3}, at: ocfs2_get_system_file_inode+0x337/0x940 fs/ocfs2/sysfile.c:101 but task is already holding lock: ffff88805f248660 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_expand_inline_dir.constprop.0+0x3e7/0x4190 fs/ocfs2/dir.c:2801 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}: down_read+0x9a/0x330 kernel/locking/rwsem.c:1526 ocfs2_read_virt_blocks+0x25e/0x940 fs/ocfs2/extent_map.c:976 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc91/0x1b70 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk+0xdd/0x390 fs/ocfs2/dir.c:1981 ocfs2_lookup_ino_from_name+0x9e/0xf0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2250 ocfs2_fill_super+0xfb2/0x4370 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1679 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1800 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4055 [inline] __se_sys_mount fs/namespace.c:4032 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4032 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&osb->system_file_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x24ed/0x3cb0 kernel/locking/lockdep.c:5142 lock_acquire kernel/locking/lockdep.c:5759 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5724 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 ocfs2_get_system_file_inode+0x337/0x940 fs/ocfs2/sysfile.c:101 ocfs2_reserve_suballoc_bits+0xf8/0x4930 fs/ocfs2/suballoc.c:780 ocfs2_reserve_new_metadata_blocks+0x52e/0xc70 fs/ocfs2/suballoc.c:982 ocfs2_expand_inline_dir.constprop.0+0xddb/0x4190 fs/ocfs2/dir.c:2820 ocfs2_extend_dir+0x1e0/0x1cb0 fs/ocfs2/dir.c:3182 ocfs2_prepare_dir_for_insert+0x12b2/0x1700 fs/ocfs2/dir.c:4297 ocfs2_mknod+0x8ea/0x2440 fs/ocfs2/namei.c:292 ocfs2_create+0x185/0x450 fs/ocfs2/namei.c:672 vfs_create fs/namei.c:3294 [inline] vfs_create+0x4c5/0x770 fs/namei.c:3278 do_mknodat+0x3d5/0x5d0 fs/namei.c:4185 __do_sys_mknod fs/namei.c:4218 [inline] __se_sys_mknod fs/namei.c:4216 [inline] __x64_sys_mknod+0x87/0xb0 fs/namei.c:4216 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ocfs2_file_ip_alloc_sem_key); lock(&osb->system_file_mutex); lock(&ocfs2_file_ip_alloc_sem_key); lock(&osb->system_file_mutex); *** DEADLOCK *** 3 locks held by syz.1.8/5340: #0: ffff88804324a420 (sb_writers#12){.+.+}-{0:0}, at: filename_create+0x10d/0x530 fs/namei.c:4019 #1: ffff88805f2489c0 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:850 [inline] #1: ffff88805f2489c0 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: filename_create+0x1c2/0x530 fs/namei.c:4026 #2: ffff88805f248660 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_expand_inline_dir.constprop.0+0x3e7/0x4190 fs/ocfs2/dir.c:2801 stack backtrace: CPU: 0 UID: 0 PID: 5340 Comm: syz.1.8 Not tainted 6.11.0-syzkaller-02574-ga430d95c5efa #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2186 check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x24ed/0x3cb0 kernel/locking/lockdep.c:5142 lock_acquire kernel/locking/lockdep.c:5759 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5724 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 ocfs2_get_system_file_inode+0x337/0x940 fs/ocfs2/sysfile.c:101 ocfs2_reserve_suballoc_bits+0xf8/0x4930 fs/ocfs2/suballoc.c:780 ocfs2_reserve_new_metadata_blocks+0x52e/0xc70 fs/ocfs2/suballoc.c:982 ocfs2_expand_inline_dir.constprop.0+0xddb/0x4190 fs/ocfs2/dir.c:2820 ocfs2_extend_dir+0x1e0/0x1cb0 fs/ocfs2/dir.c:3182 ocfs2_prepare_dir_for_insert+0x12b2/0x1700 fs/ocfs2/dir.c:4297 ocfs2_mknod+0x8ea/0x2440 fs/ocfs2/namei.c:292 ocfs2_create+0x185/0x450 fs/ocfs2/namei.c:672 vfs_create fs/namei.c:3294 [inline] vfs_create+0x4c5/0x770 fs/namei.c:3278 do_mknodat+0x3d5/0x5d0 fs/namei.c:4185 __do_sys_mknod fs/namei.c:4218 [inline] __se_sys_mknod fs/namei.c:4216 [inline] __x64_sys_mknod+0x87/0xb0 fs/namei.c:4216 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fccd9b7def9 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:00007fccdaa47038 EFLAGS: 00000246 ORIG_RAX: 0000000000000085 RAX: ffffffffffffffda RBX: 00007fccd9d35f80 RCX: 00007fccd9b7def9 RDX: 0000000000000703 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007fccd9bf0b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fccd9d35f80 R15: 00007ffc8f492fb8