====================================================== WARNING: possible circular locking dependency detected 6.16.0-rc4-syzkaller-00324-g1f988d0788f5 #0 Not tainted ------------------------------------------------------ syz.1.1041/9580 is trying to acquire lock: ffff88804f4c4618 (sb_internal){++++}-{0:0}, at: percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] ffff88804f4c4618 (sb_internal){++++}-{0:0}, at: __sb_start_write include/linux/fs.h:1795 [inline] ffff88804f4c4618 (sb_internal){++++}-{0:0}, at: sb_start_intwrite include/linux/fs.h:1978 [inline] ffff88804f4c4618 (sb_internal){++++}-{0:0}, at: ext4_evict_inode+0x2d6/0xee0 fs/ext4/inode.c:215 but task is already holding lock: ffff8880512c0b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1816 [inline] ffff8880512c0b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x2f3/0x1010 fs/ext4/migrate.c:438 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&sbi->s_writepages_rwsem){++++}-{0:0}: 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:1804 [inline] ext4_writepages+0x1cc/0x350 fs/ext4/inode.c:2952 do_writepages+0x32e/0x550 mm/page-writeback.c:2636 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:5524 ext4_fallocate+0x70c/0xcd0 fs/ext4/extents.c:4788 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 -> #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:934 [inline] page_cache_ra_unbounded+0x129/0x7b0 mm/readahead.c:228 do_async_mmap_readahead mm/filemap.c:3299 [inline] filemap_fault+0x59e/0x1200 mm/filemap.c:3398 __do_fault+0x138/0x390 mm/memory.c:5169 do_read_fault mm/memory.c:5590 [inline] do_fault mm/memory.c:5724 [inline] do_pte_missing mm/memory.c:4251 [inline] handle_pte_fault mm/memory.c:6069 [inline] __handle_mm_fault+0x37ed/0x5620 mm/memory.c:6212 handle_mm_fault+0x40a/0x8e0 mm/memory.c:6381 faultin_page mm/gup.c:1186 [inline] __get_user_pages+0x1af4/0x30b0 mm/gup.c:1488 __get_user_pages_locked mm/gup.c:1754 [inline] get_dump_page+0x1ac/0x3f0 mm/gup.c:2258 dump_user_range+0x1de/0xc70 fs/coredump.c:1180 elf_core_dump+0x32ed/0x3900 fs/binfmt_elf.c:2075 do_coredump+0x2809/0x3440 fs/coredump.c:950 get_signal+0x1109/0x1340 kernel/signal.c:3019 arch_do_signal_or_restart+0x9a/0x750 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline] irqentry_exit_to_user_mode+0x81/0x120 kernel/entry/common.c:184 exc_page_fault+0x9f/0xf0 arch/x86/mm/fault.c:1535 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #3 (&mm->mmap_lock){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5871 __might_fault+0xcc/0x130 mm/memory.c:6971 _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+0x16d3/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 ocfs2_setattr+0xd72/0x1b40 fs/ocfs2/file.c:1233 notify_change+0xb36/0xe40 fs/attr.c:552 chown_common+0x40c/0x5c0 fs/open.c:790 vfs_fchown fs/open.c:858 [inline] ksys_fchown+0xea/0x160 fs/open.c:870 __do_sys_fchown fs/open.c:875 [inline] __se_sys_fchown fs/open.c:873 [inline] __x64_sys_fchown+0x7a/0x90 fs/open.c:873 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:602 [inline] __mutex_lock+0x182/0xe80 kernel/locking/mutex.c:747 dquot_release+0x66/0x600 fs/quota/dquot.c:531 ext4_release_dquot+0x3ee/0x6c0 fs/ext4/ext4_jbd2.h:-1 quota_release_workfn+0x35f/0x610 fs/quota/dquot.c:840 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3321 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402 kthread+0x711/0x8a0 kernel/kthread.c:464 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #0 (sb_internal){++++}-{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_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs.h:1795 [inline] sb_start_intwrite include/linux/fs.h:1978 [inline] ext4_evict_inode+0x2d6/0xee0 fs/ext4/inode.c:215 evict+0x504/0x9c0 fs/inode.c:810 ext4_ext_migrate+0xd23/0x1010 fs/ext4/migrate.c:588 __ext4_ioctl fs/ext4/ioctl.c:1402 [inline] ext4_ioctl+0x1b1a/0x3510 fs/ext4/ioctl.c:1626 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/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 other info that might help us debug this: Chain exists of: sb_internal --> mapping.invalidate_lock#2 --> &sbi->s_writepages_rwsem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->s_writepages_rwsem); lock(mapping.invalidate_lock#2); lock(&sbi->s_writepages_rwsem); rlock(sb_internal); *** DEADLOCK *** 3 locks held by syz.1.1041/9580: #0: ffff88804f4c4428 (sb_writers#4){++++}-{0:0}, at: mnt_want_write_file+0x60/0x200 fs/namespace.c:601 #1: ffff8880561883e0 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: inode_lock include/linux/fs.h:869 [inline] #1: ffff8880561883e0 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: __ext4_ioctl fs/ext4/ioctl.c:1401 [inline] #1: ffff8880561883e0 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: ext4_ioctl+0x1b12/0x3510 fs/ext4/ioctl.c:1626 #2: ffff8880512c0b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1816 [inline] #2: ffff8880512c0b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x2f3/0x1010 fs/ext4/migrate.c:438 stack backtrace: CPU: 0 UID: 0 PID: 9580 Comm: syz.1.1041 Not tainted 6.16.0-rc4-syzkaller-00324-g1f988d0788f5 #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_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs.h:1795 [inline] sb_start_intwrite include/linux/fs.h:1978 [inline] ext4_evict_inode+0x2d6/0xee0 fs/ext4/inode.c:215 evict+0x504/0x9c0 fs/inode.c:810 ext4_ext_migrate+0xd23/0x1010 fs/ext4/migrate.c:588 __ext4_ioctl fs/ext4/ioctl.c:1402 [inline] ext4_ioctl+0x1b1a/0x3510 fs/ext4/ioctl.c:1626 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/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 RIP: 0033:0x7fe761d8e929 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:00007fe762c2f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fe761fb6080 RCX: 00007fe761d8e929 RDX: 0000000000000000 RSI: 0000000000006609 RDI: 0000000000000004 RBP: 00007fe761e10b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007fe761fb6080 R15: 00007ffcf8aaf9c8