====================================================== WARNING: possible circular locking dependency detected 6.15.0-syzkaller-02198-gb1456f6dc167 #0 Not tainted ------------------------------------------------------ syz.8.823/11707 is trying to acquire lock: ffff8880697f4b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: percpu_down_read include/linux/percpu-rwsem.h:77 [inline] ffff8880697f4b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1778 [inline] ffff8880697f4b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x1cc/0x350 fs/ext4/inode.c:2828 but task is already holding lock: ffff888057dc5f00 (mapping.invalidate_lock#2){++++}-{4:4}, at: filemap_invalidate_lock include/linux/fs.h:922 [inline] ffff888057dc5f00 (mapping.invalidate_lock#2){++++}-{4:4}, at: ext4_fallocate+0x179/0xcd0 fs/ext4/extents.c:4759 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (mapping.invalidate_lock#2){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871 down_read+0x46/0x2e0 kernel/locking/rwsem.c:1524 filemap_invalidate_lock_shared include/linux/fs.h:932 [inline] filemap_fault+0x546/0x1200 mm/filemap.c:3391 __do_fault+0x138/0x390 mm/memory.c:5098 do_read_fault mm/memory.c:5518 [inline] do_fault mm/memory.c:5652 [inline] do_pte_missing mm/memory.c:4160 [inline] handle_pte_fault mm/memory.c:5997 [inline] __handle_mm_fault+0x37c5/0x55e0 mm/memory.c:6140 handle_mm_fault+0x2d5/0x7f0 mm/memory.c:6309 faultin_page mm/gup.c:1193 [inline] __get_user_pages+0x1a78/0x30c0 mm/gup.c:1491 populate_vma_page_range+0x26b/0x340 mm/gup.c:1929 __mm_populate+0x24c/0x380 mm/gup.c:2032 mm_populate include/linux/mm.h:3487 [inline] vm_mmap_pgoff+0x3f0/0x4c0 mm/util.c:584 ksys_mmap_pgoff+0x51f/0x760 mm/mmap.c:607 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 -> #3 (&mm->mmap_lock){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871 __might_fault+0xcc/0x130 mm/memory.c:7151 _inline_copy_to_user include/linux/uaccess.h:192 [inline] _copy_to_user+0x2c/0xb0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:225 [inline] fiemap_fill_next_extent+0x1c0/0x390 fs/ioctl.c:145 ocfs2_fiemap+0x888/0xc90 fs/ocfs2/extent_map.c:806 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x16d0/0x1990 fs/ioctl.c:841 __do_sys_ioctl fs/ioctl.c:905 [inline] __se_sys_ioctl+0x82/0x170 fs/ioctl.c:893 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_quota_ip_alloc_sem_key){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871 down_write+0x96/0x1f0 kernel/locking/rwsem.c:1577 ocfs2_create_local_dquot+0x19d/0x1a40 fs/ocfs2/quota_local.c:1227 ocfs2_acquire_dquot+0x80f/0xb30 fs/ocfs2/quota_global.c:883 dqget+0x7b1/0xf10 fs/quota/dquot.c:977 dquot_get_dqblk+0x22/0x60 fs/quota/dquot.c:2684 quota_getquota+0x287/0x4f0 fs/quota/quota.c:214 __do_sys_quotactl fs/quota/quota.c:961 [inline] __se_sys_quotactl+0x279/0x950 fs/quota/quota.c:917 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 (&dquot->dq_lock){+.+.}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x182/0xe80 kernel/locking/mutex.c:746 wait_on_dquot fs/quota/dquot.c:354 [inline] dqget+0x72a/0xf10 fs/quota/dquot.c:972 __dquot_initialize+0x3b3/0xcb0 fs/quota/dquot.c:1505 __ext4_new_inode+0x7db/0x3bd0 fs/ext4/ialloc.c:994 ext4_ext_migrate+0x69f/0x1010 fs/ext4/migrate.c:456 __ext4_ioctl fs/ext4/ioctl.c:1402 [inline] ext4_ioctl+0x1afe/0x34f0 fs/ext4/ioctl.c:1620 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:893 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 (&sbi->s_writepages_rwsem){++++}-{0:0}: 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 percpu_down_read_internal+0x48/0x1c0 include/linux/percpu-rwsem.h:53 percpu_down_read include/linux/percpu-rwsem.h:77 [inline] ext4_writepages_down_read fs/ext4/ext4.h:1778 [inline] ext4_writepages+0x1cc/0x350 fs/ext4/inode.c:2828 do_writepages+0x32b/0x550 mm/page-writeback.c:2635 filemap_fdatawrite_wbc mm/filemap.c:386 [inline] __filemap_fdatawrite_range mm/filemap.c:419 [inline] filemap_write_and_wait_range+0x217/0x310 mm/filemap.c:691 ext4_insert_range+0x33f/0xb40 fs/ext4/extents.c:5409 ext4_fallocate+0x70c/0xcd0 fs/ext4/extents.c:4770 vfs_fallocate+0x6a3/0x830 fs/open.c:341 ksys_fallocate fs/open.c:365 [inline] __do_sys_fallocate fs/open.c:370 [inline] __se_sys_fallocate fs/open.c:368 [inline] __x64_sys_fallocate+0xc0/0x110 fs/open.c:368 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: &sbi->s_writepages_rwsem --> &mm->mmap_lock --> mapping.invalidate_lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(mapping.invalidate_lock#2); lock(&mm->mmap_lock); lock(mapping.invalidate_lock#2); rlock(&sbi->s_writepages_rwsem); *** DEADLOCK *** 3 locks held by syz.8.823/11707: #0: ffff8880697f0428 (sb_writers#4){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3068 [inline] #0: ffff8880697f0428 (sb_writers#4){.+.+}-{0:0}, at: vfs_fallocate+0x62a/0x830 fs/open.c:340 #1: ffff888057dc5d60 (&sb->s_type->i_mutex_key#8){++++}-{4:4}, at: inode_lock include/linux/fs.h:867 [inline] #1: ffff888057dc5d60 (&sb->s_type->i_mutex_key#8){++++}-{4:4}, at: ext4_fallocate+0xf0/0xcd0 fs/ext4/extents.c:4737 #2: ffff888057dc5f00 (mapping.invalidate_lock#2){++++}-{4:4}, at: filemap_invalidate_lock include/linux/fs.h:922 [inline] #2: ffff888057dc5f00 (mapping.invalidate_lock#2){++++}-{4:4}, at: ext4_fallocate+0x179/0xcd0 fs/ext4/extents.c:4759 stack backtrace: CPU: 1 UID: 0 PID: 11707 Comm: syz.8.823 Not tainted 6.15.0-syzkaller-02198-gb1456f6dc167 #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 percpu_down_read_internal+0x48/0x1c0 include/linux/percpu-rwsem.h:53 percpu_down_read include/linux/percpu-rwsem.h:77 [inline] ext4_writepages_down_read fs/ext4/ext4.h:1778 [inline] ext4_writepages+0x1cc/0x350 fs/ext4/inode.c:2828 do_writepages+0x32b/0x550 mm/page-writeback.c:2635 filemap_fdatawrite_wbc mm/filemap.c:386 [inline] __filemap_fdatawrite_range mm/filemap.c:419 [inline] filemap_write_and_wait_range+0x217/0x310 mm/filemap.c:691 ext4_insert_range+0x33f/0xb40 fs/ext4/extents.c:5409 ext4_fallocate+0x70c/0xcd0 fs/ext4/extents.c:4770 vfs_fallocate+0x6a3/0x830 fs/open.c:341 ksys_fallocate fs/open.c:365 [inline] __do_sys_fallocate fs/open.c:370 [inline] __se_sys_fallocate fs/open.c:368 [inline] __x64_sys_fallocate+0xc0/0x110 fs/open.c:368 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:0x7f9b4598e969 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:00007f9b4677d038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d RAX: ffffffffffffffda RBX: 00007f9b45bb6080 RCX: 00007f9b4598e969 RDX: 0000000000000000 RSI: 0000000000000020 RDI: 0000000000000004 RBP: 00007f9b45a10ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000008000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f9b45bb6080 R15: 00007ffe86e17b38