loop2: detected capacity change from 0 to 65536 XFS (loop2): Mounting V5 Filesystem d6f69dbd-8c5d-46be-b88e-92c0ae88ceb2 XFS (loop2): Ending clean mount XFS (loop2): Quotacheck needed: Please wait. XFS (loop2): Quotacheck: Done. ====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc2-syzkaller #0 Not tainted ------------------------------------------------------ syz.2.16/4379 is trying to acquire lock: ffff88817ec1c170 (&lp->qli_lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff88817ec1c170 (&lp->qli_lock){+.+.}-{3:3}, at: xfs_dquot_detach_buf+0x1b/0x90 fs/xfs/xfs_dquot.c:83 but task is already holding lock: ffff888107fc90b0 (&l->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff888107fc90b0 (&l->lock){+.+.}-{3:3}, at: lock_list_lru_of_memcg+0x120/0x1e0 mm/list_lru.c:77 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&l->lock){+.+.}-{3:3}: __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] lock_list_lru_of_memcg+0x120/0x1e0 mm/list_lru.c:77 list_lru_add+0x33/0xe0 mm/list_lru.c:164 xfs_buf_rele_cached fs/xfs/xfs_buf.c:1106 [inline] xfs_buf_rele+0x136/0x940 fs/xfs/xfs_buf.c:1151 xfs_imap_lookup+0x126/0x1c0 fs/xfs/libxfs/xfs_ialloc.c:2431 xfs_imap+0x14e/0x250 xfs_iget_cache_miss fs/xfs/xfs_icache.c:644 [inline] xfs_iget+0x35b/0xea0 fs/xfs/xfs_icache.c:806 xfs_mountfs+0x503/0x900 fs/xfs/xfs_mount.c:919 xfs_fs_fill_super+0x679/0x7f0 fs/xfs/xfs_super.c:1791 get_tree_bdev_flags+0x13f/0x1c0 fs/super.c:1636 vfs_get_tree+0x24/0xb0 fs/super.c:1814 do_new_mount+0x15a/0x3a0 fs/namespace.c:3507 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount+0x174/0x1e0 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xa0/0x1b0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&bch->bc_lock){+.+.}-{3:3}: __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] _atomic_dec_and_lock+0x2c/0x50 lib/dec_and_lock.c:28 xfs_buf_rele_cached fs/xfs/xfs_buf.c:1085 [inline] xfs_buf_rele+0xbc/0x940 fs/xfs/xfs_buf.c:1151 xfs_imap_lookup+0x126/0x1c0 fs/xfs/libxfs/xfs_ialloc.c:2431 xfs_imap+0x14e/0x250 xfs_iget_cache_miss fs/xfs/xfs_icache.c:644 [inline] xfs_iget+0x35b/0xea0 fs/xfs/xfs_icache.c:806 xfs_mountfs+0x503/0x900 fs/xfs/xfs_mount.c:919 xfs_fs_fill_super+0x679/0x7f0 fs/xfs/xfs_super.c:1791 get_tree_bdev_flags+0x13f/0x1c0 fs/super.c:1636 vfs_get_tree+0x24/0xb0 fs/super.c:1814 do_new_mount+0x15a/0x3a0 fs/namespace.c:3507 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount+0x174/0x1e0 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xa0/0x1b0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&bp->b_lock){+.+.}-{3:3}: __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] xfs_buf_rele_cached fs/xfs/xfs_buf.c:1084 [inline] xfs_buf_rele+0xaa/0x940 fs/xfs/xfs_buf.c:1151 xfs_dquot_attach_buf+0x10e/0x180 fs/xfs/xfs_dquot.c:1345 xfs_qm_quotacheck_dqadjust+0x53/0x140 fs/xfs/xfs_qm.c:1334 xfs_qm_dqusage_adjust+0x1a1/0x220 fs/xfs/xfs_qm.c:1457 xfs_iwalk_ag_recs+0x133/0x1b0 fs/xfs/xfs_iwalk.c:209 xfs_iwalk_run_callbacks+0x8d/0x130 fs/xfs/xfs_iwalk.c:370 xfs_iwalk_ag+0x202/0x2a0 fs/xfs/xfs_iwalk.c:476 xfs_iwalk_ag_work+0x4e/0x90 fs/xfs/xfs_iwalk.c:625 xfs_pwork_work+0x17/0x60 fs/xfs/xfs_pwork.c:47 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0x2ab/0x5c0 kernel/workqueue.c:3310 worker_thread+0x23e/0x2e0 kernel/workqueue.c:3391 kthread+0xea/0x100 kernel/kthread.c:389 ret_from_fork+0x32/0x40 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 (&lp->qli_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x1236/0x2570 kernel/locking/lockdep.c:5226 lock_acquire+0xeb/0x270 kernel/locking/lockdep.c:5849 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] xfs_dquot_detach_buf+0x1b/0x90 fs/xfs/xfs_dquot.c:83 xfs_qm_dquot_isolate+0x13e/0x530 fs/xfs/xfs_qm.c:528 __list_lru_walk_one+0xb4/0x1a0 mm/list_lru.c:301 list_lru_walk_one+0xb/0x20 mm/list_lru.c:338 list_lru_shrink_walk include/linux/list_lru.h:240 [inline] xfs_qm_shrink_scan+0x70/0x100 fs/xfs/xfs_qm.c:574 do_shrink_slab+0x24f/0x5a0 mm/shrinker.c:437 shrink_slab+0x1d3/0x7e0 mm/shrinker.c:664 drop_slab_node mm/vmscan.c:414 [inline] drop_slab+0x89/0x100 mm/vmscan.c:432 drop_caches_sysctl_handler+0x4b/0xb0 fs/drop_caches.c:68 proc_sys_call_handler+0x19d/0x2c0 fs/proc/proc_sysctl.c:601 do_iter_readv_writev+0x172/0x1c0 vfs_writev+0x214/0x410 fs/read_write.c:1050 do_writev+0x71/0x110 fs/read_write.c:1096 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xa0/0x1b0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &lp->qli_lock --> &bch->bc_lock --> &l->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&l->lock); lock(&bch->bc_lock); lock(&l->lock); lock(&lp->qli_lock); *** DEADLOCK *** 4 locks held by syz.2.16/4379: #0: ffff88811725f5f8 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x7c/0xb0 fs/file.c:1191 #1: ffff888115e85410 (sb_writers#3){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2964 [inline] #1: ffff888115e85410 (sb_writers#3){.+.+}-{0:0}, at: vfs_writev+0x1f2/0x410 fs/read_write.c:1048 #2: ffff888107fc90b0 (&l->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff888107fc90b0 (&l->lock){+.+.}-{3:3}, at: lock_list_lru_of_memcg+0x120/0x1e0 mm/list_lru.c:77 #3: ffff88817ec1c258 (&xfs_dquot_group_class){+.+.}-{4:4}, at: xfs_dqlock_nowait fs/xfs/xfs_dquot.h:126 [inline] #3: ffff88817ec1c258 (&xfs_dquot_group_class){+.+.}-{4:4}, at: xfs_qm_dquot_isolate+0x37/0x530 fs/xfs/xfs_qm.c:467 stack backtrace: CPU: 0 UID: 0 PID: 4379 Comm: syz.2.16 Not tainted 6.13.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xa3/0x100 lib/dump_stack.c:120 print_circular_bug+0x28d/0x2a0 kernel/locking/lockdep.c:2074 check_noncircular+0x119/0x140 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x1236/0x2570 kernel/locking/lockdep.c:5226 lock_acquire+0xeb/0x270 kernel/locking/lockdep.c:5849 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] xfs_dquot_detach_buf+0x1b/0x90 fs/xfs/xfs_dquot.c:83 xfs_qm_dquot_isolate+0x13e/0x530 fs/xfs/xfs_qm.c:528 __list_lru_walk_one+0xb4/0x1a0 mm/list_lru.c:301 list_lru_walk_one+0xb/0x20 mm/list_lru.c:338 list_lru_shrink_walk include/linux/list_lru.h:240 [inline] xfs_qm_shrink_scan+0x70/0x100 fs/xfs/xfs_qm.c:574 do_shrink_slab+0x24f/0x5a0 mm/shrinker.c:437 shrink_slab+0x1d3/0x7e0 mm/shrinker.c:664 drop_slab_node mm/vmscan.c:414 [inline] drop_slab+0x89/0x100 mm/vmscan.c:432 drop_caches_sysctl_handler+0x4b/0xb0 fs/drop_caches.c:68 proc_sys_call_handler+0x19d/0x2c0 fs/proc/proc_sysctl.c:601 do_iter_readv_writev+0x172/0x1c0 vfs_writev+0x214/0x410 fs/read_write.c:1050 do_writev+0x71/0x110 fs/read_write.c:1096 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xa0/0x1b0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f3624385d19 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:00007f36251af038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f3624575fa0 RCX: 00007f3624385d19 RDX: 0000000000000001 RSI: 00000000200000c0 RDI: 0000000000000004 RBP: 00007f3624401a20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f3624575fa0 R15: 00007ffda331ef48 syz.2.16 (4379): drop_caches: 2