ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected 5.15.186-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.25/4421 is trying to acquire lock: ffff8880782d4e28 ( &mm->mmap_lock){++++}-{3:3}, at: __might_fault+0x90/0x110 mm/memory.c:5356 but task is already holding lock: ffff888072addbe0 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_fiemap+0x2a2/0xc40 fs/ocfs2/extent_map.c:755 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}: down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 ocfs2_read_virt_blocks+0x23f/0x8a0 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+0x3d1/0x1f90 fs/ocfs2/dir.c:1091 ocfs2_find_files_on_disk+0xdb/0x2f0 fs/ocfs2/dir.c:1995 ocfs2_lookup_ino_from_name+0x4f/0xf0 fs/ocfs2/dir.c:2017 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x319/0x760 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes+0x316/0x650 fs/ocfs2/super.c:458 ocfs2_initialize_super fs/ocfs2/super.c:2279 [inline] ocfs2_fill_super+0x3dbf/0x4d80 fs/ocfs2/super.c:995 mount_bdev+0x287/0x3c0 fs/super.c:1400 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x24a/0xa40 fs/namespace.c:3014 do_mount fs/namespace.c:3357 [inline] __do_sys_mount fs/namespace.c:3565 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3542 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #3 (&osb->system_file_mutex){+.+.}-{3:3}: __mutex_lock_common+0x1eb/0x2390 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+0x1b5/0x760 fs/ocfs2/sysfile.c:101 ocfs2_reserve_suballoc_bits+0x139/0x4350 fs/ocfs2/suballoc.c:776 ocfs2_reserve_new_metadata_blocks+0x400/0x940 fs/ocfs2/suballoc.c:978 ocfs2_reserve_new_metadata fs/ocfs2/suballoc.c:1021 [inline] ocfs2_lock_allocators+0x29b/0x5b0 fs/ocfs2/suballoc.c:2658 ocfs2_extend_allocation+0x397/0x1760 fs/ocfs2/file.c:588 ocfs2_allocate_unwritten_extents+0x2e6/0x7b0 fs/ocfs2/file.c:1499 __ocfs2_change_file_space+0x81d/0xe20 fs/ocfs2/file.c:2026 ocfs2_fallocate+0x1ee/0x240 fs/ocfs2/file.c:2141 vfs_fallocate+0x587/0x6f0 fs/open.c:308 ksys_fallocate fs/open.c:331 [inline] __do_sys_fallocate fs/open.c:339 [inline] __se_sys_fallocate fs/open.c:337 [inline] __x64_sys_fallocate+0xbd/0x100 fs/open.c:337 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #2 (&oi->ip_alloc_sem){++++}-{3:3}: down_write+0x38/0x60 kernel/locking/rwsem.c:1551 ocfs2_page_mkwrite+0x2ce/0xad0 fs/ocfs2/mmap.c:142 do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922 do_shared_fault mm/memory.c:4328 [inline] do_fault mm/memory.c:4396 [inline] handle_pte_fault mm/memory.c:4650 [inline] __handle_mm_fault mm/memory.c:4785 [inline] handle_mm_fault+0x1d4b/0x43c0 mm/memory.c:4883 faultin_page mm/gup.c:976 [inline] __get_user_pages+0x93e/0x11c0 mm/gup.c:1197 __get_user_pages_locked mm/gup.c:1442 [inline] get_user_pages_unlocked+0x400/0x6f0 mm/gup.c:2222 __gup_longterm_unlocked mm/gup.c:2823 [inline] internal_get_user_pages_fast+0x1c9d/0x2080 mm/gup.c:2911 iov_iter_get_pages+0x225/0x5b0 lib/iov_iter.c:1544 dio_refill_pages fs/direct-io.c:173 [inline] dio_get_page fs/direct-io.c:217 [inline] do_direct_IO fs/direct-io.c:938 [inline] do_blockdev_direct_IO fs/direct-io.c:1276 [inline] __blockdev_direct_IO+0x1060/0x3c90 fs/direct-io.c:1368 ocfs2_direct_IO+0x23e/0x2b0 fs/ocfs2/aops.c:2468 generic_file_read_iter+0x2be/0x490 mm/filemap.c:2772 ocfs2_file_read_iter+0x469/0xa20 fs/ocfs2/file.c:2592 call_read_iter include/linux/fs.h:2166 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0x725/0xcf0 fs/read_write.c:485 ksys_read+0x14d/0x250 fs/read_write.c:623 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #1 (sb_pagefaults#2){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1811 [inline] sb_start_pagefault include/linux/fs.h:1910 [inline] ocfs2_page_mkwrite+0x18a/0xad0 fs/ocfs2/mmap.c:122 do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922 do_shared_fault mm/memory.c:4328 [inline] do_fault mm/memory.c:4396 [inline] handle_pte_fault mm/memory.c:4650 [inline] __handle_mm_fault mm/memory.c:4785 [inline] handle_mm_fault+0x1d4b/0x43c0 mm/memory.c:4883 faultin_page mm/gup.c:976 [inline] __get_user_pages+0x93e/0x11c0 mm/gup.c:1197 __get_user_pages_locked mm/gup.c:1442 [inline] get_user_pages_unlocked+0x400/0x6f0 mm/gup.c:2222 __gup_longterm_unlocked mm/gup.c:2823 [inline] internal_get_user_pages_fast+0x1c9d/0x2080 mm/gup.c:2911 iov_iter_get_pages+0x225/0x5b0 lib/iov_iter.c:1544 dio_refill_pages fs/direct-io.c:173 [inline] dio_get_page fs/direct-io.c:217 [inline] do_direct_IO fs/direct-io.c:938 [inline] do_blockdev_direct_IO fs/direct-io.c:1276 [inline] __blockdev_direct_IO+0x1060/0x3c90 fs/direct-io.c:1368 ocfs2_direct_IO+0x23e/0x2b0 fs/ocfs2/aops.c:2468 generic_file_read_iter+0x2be/0x490 mm/filemap.c:2772 ocfs2_file_read_iter+0x469/0xa20 fs/ocfs2/file.c:2592 call_read_iter include/linux/fs.h:2166 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0x725/0xcf0 fs/read_write.c:485 ksys_read+0x14d/0x250 fs/read_write.c:623 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&mm->mmap_lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __might_fault+0xb3/0x110 mm/memory.c:5357 _copy_to_user+0x29/0x130 lib/usercopy.c:35 copy_to_user include/linux/uaccess.h:200 [inline] fiemap_fill_next_extent+0x19d/0x360 fs/ioctl.c:144 ocfs2_fiemap_inline fs/ocfs2/extent_map.c:725 [inline] ocfs2_fiemap+0x999/0xc40 fs/ocfs2/extent_map.c:762 ioctl_fiemap fs/ioctl.c:219 [inline] do_vfs_ioctl+0x1464/0x1de0 fs/ioctl.c:814 __do_sys_ioctl fs/ioctl.c:872 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: &mm->mmap_lock --> &osb->system_file_mutex --> &ocfs2_file_ip_alloc_sem_key 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(&mm->mmap_lock); *** DEADLOCK *** 1 lock held by syz.0.25/4421: #0: ffff888072addbe0 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_fiemap+0x2a2/0xc40 fs/ocfs2/extent_map.c:755 stack backtrace: CPU: 1 PID: 4421 Comm: syz.0.25 Not tainted 5.15.186-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 check_noncircular+0x274/0x310 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 kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __might_fault+0xb3/0x110 mm/memory.c:5357 _copy_to_user+0x29/0x130 lib/usercopy.c:35 copy_to_user include/linux/uaccess.h:200 [inline] fiemap_fill_next_extent+0x19d/0x360 fs/ioctl.c:144 ocfs2_fiemap_inline fs/ocfs2/extent_map.c:725 [inline] ocfs2_fiemap+0x999/0xc40 fs/ocfs2/extent_map.c:762 ioctl_fiemap fs/ioctl.c:219 [inline] do_vfs_ioctl+0x1464/0x1de0 fs/ioctl.c:814 __do_sys_ioctl fs/ioctl.c:872 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fdc8db3b929 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:00007fdc8b9a3038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fdc8dd62fa0 RCX: 00007fdc8db3b929 RDX: 0000200000000200 RSI: 00000000c020660b RDI: 0000000000000004 RBP: 00007fdc8dbbdb39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fdc8dd62fa0 R15: 00007ffcfe449948