loop0: detected capacity change from 0 to 512 EXT4-fs (loop0): orphan cleanup on readonly fs ====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc8-syzkaller-33330-ga5541c0811a0 #0 Not tainted ------------------------------------------------------ syz-executor124/3085 is trying to acquire lock: ffff0000ca6446a8 (&dquot->dq_lock){+.+.}-{3:3}, at: dquot_commit+0x34/0x1e4 fs/quota/dquot.c:479 but task is already holding lock: ffff0000ca53c578 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_truncate+0x52c/0x72c fs/ext4/inode.c:4259 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ei->i_data_sem/2){++++}-{3:3}: down_read+0x5c/0x78 kernel/locking/rwsem.c:1509 ext4_map_blocks+0x15c/0xaec fs/ext4/inode.c:568 ext4_getblk+0xc4/0x448 fs/ext4/inode.c:858 ext4_bread+0x3c/0x164 fs/ext4/inode.c:914 ext4_quota_write+0x120/0x31c fs/ext4/super.c:7082 write_blk fs/quota/quota_tree.c:64 [inline] get_free_dqblk+0x100/0x1c8 fs/quota/quota_tree.c:130 find_free_dqentry fs/quota/quota_tree.c:276 [inline] do_insert_tree+0x5c4/0x8b8 fs/quota/quota_tree.c:373 do_insert_tree+0x2a4/0x8b8 fs/quota/quota_tree.c:375 do_insert_tree+0x2a4/0x8b8 fs/quota/quota_tree.c:375 do_insert_tree+0x2a4/0x8b8 fs/quota/quota_tree.c:375 dq_insert_tree fs/quota/quota_tree.c:401 [inline] qtree_write_dquot+0x188/0x204 fs/quota/quota_tree.c:420 v2_write_dquot+0x70/0xb0 fs/quota/quota_v2.c:358 dquot_acquire+0x158/0x23c fs/quota/dquot.c:444 ext4_acquire_dquot+0xd4/0x11c fs/ext4/super.c:6738 dqget+0x44c/0x5c0 fs/quota/dquot.c:914 __dquot_initialize+0x15c/0x588 fs/quota/dquot.c:1492 dquot_initialize+0x24/0x34 fs/quota/dquot.c:1550 ext4_process_orphan+0x34/0x16c fs/ext4/orphan.c:329 ext4_orphan_cleanup+0x584/0x8ec fs/ext4/orphan.c:474 __ext4_fill_super+0x29fc/0x2c2c fs/ext4/super.c:5515 ext4_fill_super+0x100/0x2d8 fs/ext4/super.c:5643 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1324 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5673 vfs_get_tree+0x40/0x140 fs/super.c:1531 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 path_mount+0x358/0x890 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __arm64_sys_mount+0x2c4/0x3c4 fs/namespace.c:3568 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x140 arch/arm64/kernel/syscall.c:197 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 -> #1 (&s->s_dquot.dqio_sem){++++}-{3:3}: down_read+0x5c/0x78 kernel/locking/rwsem.c:1509 v2_read_dquot+0x28/0x64 fs/quota/quota_v2.c:332 dquot_acquire+0x74/0x23c fs/quota/dquot.c:435 ext4_acquire_dquot+0xd4/0x11c fs/ext4/super.c:6738 dqget+0x44c/0x5c0 fs/quota/dquot.c:914 __dquot_initialize+0x1b8/0x588 fs/quota/dquot.c:1492 dquot_initialize+0x24/0x34 fs/quota/dquot.c:1550 ext4_process_orphan+0x34/0x16c fs/ext4/orphan.c:329 ext4_orphan_cleanup+0x584/0x8ec fs/ext4/orphan.c:474 __ext4_fill_super+0x29fc/0x2c2c fs/ext4/super.c:5515 ext4_fill_super+0x100/0x2d8 fs/ext4/super.c:5643 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1324 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5673 vfs_get_tree+0x40/0x140 fs/super.c:1531 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 path_mount+0x358/0x890 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __arm64_sys_mount+0x2c4/0x3c4 fs/namespace.c:3568 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x140 arch/arm64/kernel/syscall.c:197 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 -> #0 (&dquot->dq_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x1530/0x3084 kernel/locking/lockdep.c:5055 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 __mutex_lock_common+0xd4/0xca8 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 dquot_commit+0x34/0x1e4 fs/quota/dquot.c:479 ext4_write_dquot fs/ext4/super.c:6722 [inline] ext4_mark_dquot_dirty+0xdc/0x148 fs/ext4/super.c:6770 mark_dquot_dirty fs/quota/dquot.c:346 [inline] mark_all_dquot_dirty fs/quota/dquot.c:384 [inline] __dquot_free_space+0x374/0x594 fs/quota/dquot.c:1907 dquot_free_space_nodirty include/linux/quotaops.h:379 [inline] dquot_free_space include/linux/quotaops.h:384 [inline] dquot_free_block include/linux/quotaops.h:395 [inline] ext4_mb_clear_bb+0xa84/0xd90 fs/ext4/mballoc.c:6050 ext4_free_blocks+0x5c8/0x638 fs/ext4/mballoc.c:6179 ext4_remove_blocks fs/ext4/extents.c:2545 [inline] ext4_ext_rm_leaf+0x9c0/0x10c4 fs/ext4/extents.c:2711 ext4_ext_remove_space+0x400/0xac4 fs/ext4/extents.c:2959 ext4_ext_truncate+0xd4/0x144 fs/ext4/extents.c:4417 ext4_truncate+0x620/0x72c fs/ext4/inode.c:4264 ext4_process_orphan+0xc4/0x16c fs/ext4/orphan.c:339 ext4_orphan_cleanup+0x584/0x8ec fs/ext4/orphan.c:474 __ext4_fill_super+0x29fc/0x2c2c fs/ext4/super.c:5515 ext4_fill_super+0x100/0x2d8 fs/ext4/super.c:5643 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1324 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5673 vfs_get_tree+0x40/0x140 fs/super.c:1531 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 path_mount+0x358/0x890 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __arm64_sys_mount+0x2c4/0x3c4 fs/namespace.c:3568 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x140 arch/arm64/kernel/syscall.c:197 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 other info that might help us debug this: Chain exists of: &dquot->dq_lock --> &s->s_dquot.dqio_sem --> &ei->i_data_sem/2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem/2); lock(&s->s_dquot.dqio_sem); lock(&ei->i_data_sem/2); lock(&dquot->dq_lock); *** DEADLOCK *** 4 locks held by syz-executor124/3085: #0: ffff0000cb5060e0 (&type->s_umount_key#25/1){+.+.}-{3:3}, at: alloc_super+0xf8/0x430 fs/super.c:228 #1: ffff0000ca53c6f0 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #1: ffff0000ca53c6f0 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_process_orphan+0xb0/0x16c fs/ext4/orphan.c:337 #2: ffff0000ca53c578 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_truncate+0x52c/0x72c fs/ext4/inode.c:4259 #3: ffff80000d4f22f8 (dquot_srcu){....}-{0:0}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:303 stack backtrace: CPU: 0 PID: 3085 Comm: syz-executor124 Not tainted 6.1.0-rc8-syzkaller-33330-ga5541c0811a0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:156 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:163 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x104/0x16c lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_circular_bug+0x2c4/0x2c8 kernel/locking/lockdep.c:2055 check_noncircular+0x14c/0x154 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x1530/0x3084 kernel/locking/lockdep.c:5055 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 __mutex_lock_common+0xd4/0xca8 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 dquot_commit+0x34/0x1e4 fs/quota/dquot.c:479 ext4_write_dquot fs/ext4/super.c:6722 [inline] ext4_mark_dquot_dirty+0xdc/0x148 fs/ext4/super.c:6770 mark_dquot_dirty fs/quota/dquot.c:346 [inline] mark_all_dquot_dirty fs/quota/dquot.c:384 [inline] __dquot_free_space+0x374/0x594 fs/quota/dquot.c:1907 dquot_free_space_nodirty include/linux/quotaops.h:379 [inline] dquot_free_space include/linux/quotaops.h:384 [inline] dquot_free_block include/linux/quotaops.h:395 [inline] ext4_mb_clear_bb+0xa84/0xd90 fs/ext4/mballoc.c:6050 ext4_free_blocks+0x5c8/0x638 fs/ext4/mballoc.c:6179 ext4_remove_blocks fs/ext4/extents.c:2545 [inline] ext4_ext_rm_leaf+0x9c0/0x10c4 fs/ext4/extents.c:2711 ext4_ext_remove_space+0x400/0xac4 fs/ext4/extents.c:2959 ext4_ext_truncate+0xd4/0x144 fs/ext4/extents.c:4417 ext4_truncate+0x620/0x72c fs/ext4/inode.c:4264 ext4_process_orphan+0xc4/0x16c fs/ext4/orphan.c:339 ext4_orphan_cleanup+0x584/0x8ec fs/ext4/orphan.c:474 __ext4_fill_super+0x29fc/0x2c2c fs/ext4/super.c:5515 ext4_fill_super+0x100/0x2d8 fs/ext4/super.c:5643 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1324 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5673 vfs_get_tree+0x40/0x140 fs/super.c:1531 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 path_mount+0x358/0x890 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __arm64_sys_mount+0x2c4/0x3c4 fs/namespace.c:3568 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x140 arch/arm64/kernel/syscall.c:197 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 EXT4-fs (loop0): 1 truncate cleaned up EXT4-fs (loop0): mounted filesystem without journal. Quota mode: writeback.