loop0: detected capacity change from 0 to 32768 JBD2: Ignoring recovery information on journal ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected 5.15.167-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor147/3772 is trying to acquire lock: ffff88807cd55488 (&osb->system_file_mutex){+.+.}-{3:3}, at: ocfs2_get_system_file_inode+0x1a1/0x7b0 fs/ocfs2/sysfile.c:101 but task is already holding lock: ffff888070f414a0 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_page_mkwrite+0x301/0xbd0 fs/ocfs2/mmap.c:142 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}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498 ocfs2_read_virt_blocks+0x2b3/0xa10 fs/ocfs2/extent_map.c:976 ocfs2_read_dir_block fs/ocfs2/dir.c:508 [inline] ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0x437/0x26d0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk+0xea/0x310 fs/ocfs2/dir.c:1982 ocfs2_lookup_ino_from_name+0xad/0x1e0 fs/ocfs2/dir.c:2004 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x314/0x7b0 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes+0x328/0x720 fs/ocfs2/super.c:458 ocfs2_initialize_super fs/ocfs2/super.c:2276 [inline] ocfs2_fill_super+0x479e/0x58a0 fs/ocfs2/super.c:995 mount_bdev+0x2c9/0x3f0 fs/super.c:1398 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1528 do_new_mount+0x2ba/0xb40 fs/namespace.c:3005 do_mount fs/namespace.c:3348 [inline] __do_sys_mount fs/namespace.c:3556 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3533 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&osb->system_file_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 ocfs2_get_system_file_inode+0x1a1/0x7b0 fs/ocfs2/sysfile.c:101 ocfs2_reserve_local_alloc_bits+0x103/0x27a0 fs/ocfs2/localalloc.c:626 ocfs2_reserve_clusters_with_limit+0x1b4/0xb50 fs/ocfs2/suballoc.c:1162 ocfs2_convert_inline_data_to_extents+0x299/0x17f0 fs/ocfs2/alloc.c:7064 ocfs2_try_to_write_inline_data fs/ocfs2/aops.c:1565 [inline] ocfs2_write_begin_nolock+0x1c50/0x4d20 fs/ocfs2/aops.c:1672 __ocfs2_page_mkwrite fs/ocfs2/mmap.c:93 [inline] ocfs2_page_mkwrite+0x65f/0xbd0 fs/ocfs2/mmap.c:144 do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892 wp_page_shared+0x179/0x690 mm/memory.c:3229 handle_pte_fault mm/memory.c:4638 [inline] __handle_mm_fault mm/memory.c:4755 [inline] handle_mm_fault+0x2a3d/0x5960 mm/memory.c:4853 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 do_sys_poll+0xeda/0x11e0 fs/select.c:1025 __do_sys_ppoll fs/select.c:1120 [inline] __se_sys_ppoll+0x29c/0x330 fs/select.c:1100 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 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-executor147/3772: #0: ffff88807af8c728 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88807af8c728 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline] #0: ffff88807af8c728 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline] #0: ffff88807af8c728 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x700 arch/x86/mm/fault.c:1501 #1: ffff8880750b0558 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892 #2: ffff888070f414a0 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_page_mkwrite+0x301/0xbd0 fs/ocfs2/mmap.c:142 stack backtrace: CPU: 0 PID: 3772 Comm: syz-executor147 Not tainted 5.15.167-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 ocfs2_get_system_file_inode+0x1a1/0x7b0 fs/ocfs2/sysfile.c:101 ocfs2_reserve_local_alloc_bits+0x103/0x27a0 fs/ocfs2/localalloc.c:626 ocfs2_reserve_clusters_with_limit+0x1b4/0xb50 fs/ocfs2/suballoc.c:1162 ocfs2_convert_inline_data_to_extents+0x299/0x17f0 fs/ocfs2/alloc.c:7064 ocfs2_try_to_write_inline_data fs/ocfs2/aops.c:1565 [inline] ocfs2_write_begin_nolock+0x1c50/0x4d20 fs/ocfs2/aops.c:1672 __ocfs2_page_mkwrite fs/ocfs2/mmap.c:93 [inline] ocfs2_page_mkwrite+0x65f/0xbd0 fs/ocfs2/mmap.c:144 do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892 wp_page_shared+0x179/0x690 mm/memory.c:3229 handle_pte_fault mm/memory.c:4638 [inline] __handle_mm_fault mm/memory.c:4755 [inline] handle_mm_fault+0x2a3d/0x5960 mm/memory.c:4853 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0010:do_sys_poll+0xeda/0x11e0 fs/select.c:1025 Code: 45 31 ed 4c 89 e0 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df 0f b6 04 08 84 c0 75 2e 48 8b 84 24 90 00 00 00 42 0f b7 44 e8 06 <66> 89 02 48 89 d3 45 39 ef 74 31 e8 06 fd a4 ff 49 ff c5 49 83 c4 RSP: 0018:ffffc90003437860 EFLAGS: 00050246 RAX: 0000000000000000 RBX: ffffc90003437c78 RCX: dffffc0000000000 RDX: 0000000020000046 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffffc90003437e10 R08: ffffffff81db5d0f R09: ffffed10042bfb29 R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90003437c82 R13: 0000000000000000 R14: ffffc90003437c70 R15: 0000000000000000 __do_sys_ppoll fs/select.c:1120 [inline] __se_sys_ppoll+0x29c/0x330 fs/select.c:1100 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f0f44813bd9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 18 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0f447d0218 EFLAGS: 00000246 ORIG_RAX: 000000000000010f RAX: ffffffffffffffda RBX: 00007f0f4489f6c8 RCX: 00007f0f44813bd9 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000020000040 RBP: 00007f0f4489f6c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0f4489f6cc R13: 00007f0f4486c530 R14: 00007f0f448680c0 R15: 0031656c69662f2e OCFS2: ERROR (device loop0): int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *, handle_t *, u32, u32, struct ocfs2_suballoc_result *): Chain allocator dinode 23 has 4294967295 used bits but only 16777215 total On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted. OCFS2: Returning error to the calling process. (syz-executor147,3772,0):ocfs2_claim_suballoc_bits:1983 ERROR: status = -5 (syz-executor147,3772,0):__ocfs2_claim_clusters:2355 ERROR: status = -5 (syz-executor147,3772,0):__ocfs2_claim_clusters:2363 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_local_alloc_new_window:1203 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_local_alloc_new_window:1228 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_local_alloc_slide_window:1302 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_local_alloc_slide_window:1321 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_reserve_local_alloc_bits:671 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_reserve_local_alloc_bits:709 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_reserve_clusters_with_limit:1166 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_reserve_clusters_with_limit:1215 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_convert_inline_data_to_extents:7066 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_try_to_write_inline_data:1567 ERROR: status = -5 (syz-executor147,3772,0):ocfs2_write_begin_nolock:1679 ERROR: status = -5 (syz-executor147,3772,0):__ocfs2_page_mkwrite:97 ERROR: status = -5 ---------------- Code disassembly (best guess): 0: 45 31 ed xor %r13d,%r13d 3: 4c 89 e0 mov %r12,%rax 6: 48 c1 e8 03 shr $0x3,%rax a: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx 11: fc ff df 14: 0f b6 04 08 movzbl (%rax,%rcx,1),%eax 18: 84 c0 test %al,%al 1a: 75 2e jne 0x4a 1c: 48 8b 84 24 90 00 00 mov 0x90(%rsp),%rax 23: 00 24: 42 0f b7 44 e8 06 movzwl 0x6(%rax,%r13,8),%eax * 2a: 66 89 02 mov %ax,(%rdx) <-- trapping instruction 2d: 48 89 d3 mov %rdx,%rbx 30: 45 39 ef cmp %r13d,%r15d 33: 74 31 je 0x66 35: e8 06 fd a4 ff call 0xffa4fd40 3a: 49 ff c5 inc %r13 3d: 49 rex.WB 3e: 83 .byte 0x83 3f: c4 .byte 0xc4