EXT4-fs: Journaled quota options ignored when QUOTA feature is enabled EXT4-fs (loop0): orphan cleanup on readonly fs ====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc3-syzkaller-16369-g358a161a6a9e #0 Not tainted ------------------------------------------------------ syz-executor613/4430 is trying to acquire lock: ffff0000caf56828 (&dquot->dq_lock){+.+.}-{3:3}, at: dquot_commit+0x34/0x1e4 fs/quota/dquot.c:479 but task is already holding lock: ffff0000c9808c18 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_truncate+0x55c/0x72c fs/ext4/inode.c:4337 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:574 ext4_getblk+0xc4/0x448 fs/ext4/inode.c:864 ext4_bread+0x3c/0x164 fs/ext4/inode.c:920 ext4_quota_write+0x120/0x31c fs/ext4/super.c:7105 write_blk fs/quota/quota_tree.c:64 [inline] get_free_dqblk+0x108/0x1d0 fs/quota/quota_tree.c:130 do_insert_tree+0xdc/0x8bc fs/quota/quota_tree.c:340 do_insert_tree+0x2a0/0x8bc fs/quota/quota_tree.c:375 do_insert_tree+0x2a0/0x8bc fs/quota/quota_tree.c:375 do_insert_tree+0x2a0/0x8bc 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+0xd8/0x120 fs/ext4/super.c:6740 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:5516 ext4_fill_super+0x100/0x2e0 fs/ext4/super.c:5644 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1282 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5675 vfs_get_tree+0x40/0x140 fs/super.c:1489 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3145 path_mount+0x358/0x890 fs/namespace.c:3475 do_mount fs/namespace.c:3488 [inline] __do_sys_mount fs/namespace.c:3697 [inline] __se_sys_mount fs/namespace.c:3674 [inline] __arm64_sys_mount+0x2c4/0x3c4 fs/namespace.c:3674 __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+0xd8/0x120 fs/ext4/super.c:6740 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:5516 ext4_fill_super+0x100/0x2e0 fs/ext4/super.c:5644 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1282 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5675 vfs_get_tree+0x40/0x140 fs/super.c:1489 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3145 path_mount+0x358/0x890 fs/namespace.c:3475 do_mount fs/namespace.c:3488 [inline] __do_sys_mount fs/namespace.c:3697 [inline] __se_sys_mount fs/namespace.c:3674 [inline] __arm64_sys_mount+0x2c4/0x3c4 fs/namespace.c:3674 __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:6724 [inline] ext4_mark_dquot_dirty+0xe0/0x14c fs/ext4/super.c:6772 mark_dquot_dirty fs/quota/dquot.c:346 [inline] mark_all_dquot_dirty fs/quota/dquot.c:384 [inline] __dquot_free_space+0x380/0x5ac 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:6044 ext4_free_blocks+0x5c8/0x638 fs/ext4/mballoc.c:6173 ext4_remove_blocks fs/ext4/extents.c:2545 [inline] ext4_ext_rm_leaf+0x9c0/0x10c4 fs/ext4/extents.c:2710 ext4_ext_remove_space+0x404/0xac8 fs/ext4/extents.c:2958 ext4_ext_truncate+0xd4/0x144 fs/ext4/extents.c:4416 ext4_truncate+0x650/0x72c fs/ext4/inode.c:4342 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:5516 ext4_fill_super+0x100/0x2e0 fs/ext4/super.c:5644 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1282 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5675 vfs_get_tree+0x40/0x140 fs/super.c:1489 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3145 path_mount+0x358/0x890 fs/namespace.c:3475 do_mount fs/namespace.c:3488 [inline] __do_sys_mount fs/namespace.c:3697 [inline] __se_sys_mount fs/namespace.c:3674 [inline] __arm64_sys_mount+0x2c4/0x3c4 fs/namespace.c:3674 __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-executor613/4430: #0: ffff0000c6bc00e0 (&type->s_umount_key#25/1){+.+.}-{3:3}, at: alloc_super+0xf8/0x430 fs/super.c:228 #1: ffff0000c9808d90 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #1: ffff0000c9808d90 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_process_orphan+0xb0/0x16c fs/ext4/orphan.c:337 #2: ffff0000c9808c18 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_truncate+0x55c/0x72c fs/ext4/inode.c:4337 #3: ffff80000d693668 (dquot_srcu){....}-{0:0}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:324 stack backtrace: CPU: 0 PID: 4430 Comm: syz-executor613 Not tainted 6.2.0-rc3-syzkaller-16369-g358a161a6a9e #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:6724 [inline] ext4_mark_dquot_dirty+0xe0/0x14c fs/ext4/super.c:6772 mark_dquot_dirty fs/quota/dquot.c:346 [inline] mark_all_dquot_dirty fs/quota/dquot.c:384 [inline] __dquot_free_space+0x380/0x5ac 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:6044 ext4_free_blocks+0x5c8/0x638 fs/ext4/mballoc.c:6173 ext4_remove_blocks fs/ext4/extents.c:2545 [inline] ext4_ext_rm_leaf+0x9c0/0x10c4 fs/ext4/extents.c:2710 ext4_ext_remove_space+0x404/0xac8 fs/ext4/extents.c:2958 ext4_ext_truncate+0xd4/0x144 fs/ext4/extents.c:4416 ext4_truncate+0x650/0x72c fs/ext4/inode.c:4342 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:5516 ext4_fill_super+0x100/0x2e0 fs/ext4/super.c:5644 get_tree_bdev+0x1e8/0x2a0 fs/super.c:1282 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5675 vfs_get_tree+0x40/0x140 fs/super.c:1489 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3145 path_mount+0x358/0x890 fs/namespace.c:3475 do_mount fs/namespace.c:3488 [inline] __do_sys_mount fs/namespace.c:3697 [inline] __se_sys_mount fs/namespace.c:3674 [inline] __arm64_sys_mount+0x2c4/0x3c4 fs/namespace.c:3674 __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 00000000-0000-0000-0000-000000000000 without journal. Quota mode: writeback.