loop0: detected capacity change from 0 to 512 EXT4-fs (loop0): orphan cleanup on readonly fs ====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc7-syzkaller-18095-gbbed346d5a96 #0 Not tainted ------------------------------------------------------ syz-executor279/3035 is trying to acquire lock: ffff0000c74c4528 (&dquot->dq_lock){+.+.}-{3:3}, at: dquot_commit+0x34/0x1e4 fs/quota/dquot.c:479 but task is already holding lock: ffff0000ca51a8c8 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_truncate+0x52c/0x72c fs/ext4/inode.c:4252 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:1499 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:6956 write_blk fs/quota/quota_tree.c:64 [inline] get_free_dqblk+0xec/0x1a0 fs/quota/quota_tree.c:93 do_insert_tree+0xdc/0x838 fs/quota/quota_tree.c:300 do_insert_tree+0x24c/0x838 fs/quota/quota_tree.c:331 do_insert_tree+0x24c/0x838 fs/quota/quota_tree.c:331 do_insert_tree+0x24c/0x838 fs/quota/quota_tree.c:331 dq_insert_tree fs/quota/quota_tree.c:357 [inline] qtree_write_dquot+0x188/0x204 fs/quota/quota_tree.c:376 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:6612 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+0x34a4/0x36d4 fs/ext4/super.c:5378 ext4_fill_super+0x100/0x2d8 fs/ext4/super.c:5517 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1323 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5547 vfs_get_tree+0x40/0x140 fs/super.c:1530 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 path_mount+0x358/0x914 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/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 -> #1 (&s->s_dquot.dqio_sem){++++}-{3:3}: down_read+0x5c/0x78 kernel/locking/rwsem.c:1499 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:6612 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+0x34a4/0x36d4 fs/ext4/super.c:5378 ext4_fill_super+0x100/0x2d8 fs/ext4/super.c:5517 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1323 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5547 vfs_get_tree+0x40/0x140 fs/super.c:1530 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 path_mount+0x358/0x914 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/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 -> #0 (&dquot->dq_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x1530/0x30a4 kernel/locking/lockdep.c:5053 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5666 __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:6596 [inline] ext4_mark_dquot_dirty+0xdc/0x148 fs/ext4/super.c:6644 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:6051 ext4_free_blocks+0x5c8/0x638 fs/ext4/mballoc.c:6180 ext4_remove_blocks fs/ext4/extents.c:2542 [inline] ext4_ext_rm_leaf+0x9c0/0x10c4 fs/ext4/extents.c:2708 ext4_ext_remove_space+0x404/0xacc fs/ext4/extents.c:2956 ext4_ext_truncate+0xd4/0x144 fs/ext4/extents.c:4416 ext4_truncate+0x620/0x72c fs/ext4/inode.c:4257 ext4_process_orphan+0xc4/0x16c fs/ext4/orphan.c:339 ext4_orphan_cleanup+0x584/0x8ec fs/ext4/orphan.c:474 __ext4_fill_super+0x34a4/0x36d4 fs/ext4/super.c:5378 ext4_fill_super+0x100/0x2d8 fs/ext4/super.c:5517 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1323 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5547 vfs_get_tree+0x40/0x140 fs/super.c:1530 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 path_mount+0x358/0x914 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/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 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-executor279/3035: #0: ffff0000c96e90e0 (&type->s_umount_key#25/1){+.+.}-{3:3}, at: alloc_super+0xf8/0x430 fs/super.c:228 #1: ffff0000ca51aa40 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #1: ffff0000ca51aa40 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: ext4_process_orphan+0xb0/0x16c fs/ext4/orphan.c:337 #2: ffff0000ca51a8c8 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_truncate+0x52c/0x72c fs/ext4/inode.c:4252 #3: ffff80000d47ee98 (dquot_srcu){....}-{0:0}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:279 stack backtrace: CPU: 1 PID: 3035 Comm: syz-executor279 Not tainted 6.0.0-rc7-syzkaller-18095-gbbed346d5a96 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/30/2022 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:156 show_stack+0x2c/0x54 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:2053 check_noncircular+0x14c/0x154 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x1530/0x30a4 kernel/locking/lockdep.c:5053 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5666 __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:6596 [inline] ext4_mark_dquot_dirty+0xdc/0x148 fs/ext4/super.c:6644 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:6051 ext4_free_blocks+0x5c8/0x638 fs/ext4/mballoc.c:6180 ext4_remove_blocks fs/ext4/extents.c:2542 [inline] ext4_ext_rm_leaf+0x9c0/0x10c4 fs/ext4/extents.c:2708 ext4_ext_remove_space+0x404/0xacc fs/ext4/extents.c:2956 ext4_ext_truncate+0xd4/0x144 fs/ext4/extents.c:4416 ext4_truncate+0x620/0x72c fs/ext4/inode.c:4257 ext4_process_orphan+0xc4/0x16c fs/ext4/orphan.c:339 ext4_orphan_cleanup+0x584/0x8ec fs/ext4/orphan.c:474 __ext4_fill_super+0x34a4/0x36d4 fs/ext4/super.c:5378 ext4_fill_super+0x100/0x2d8 fs/ext4/super.c:5517 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1323 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5547 vfs_get_tree+0x40/0x140 fs/super.c:1530 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 path_mount+0x358/0x914 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/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 EXT4-fs (loop0): 1 truncate cleaned up EXT4-fs (loop0): mounted filesystem without journal. Quota mode: writeback.