====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/5386 is trying to acquire lock: 000000008608fbce (&dquot->dq_lock){+.+.}, at: dquot_commit+0x4d/0x400 fs/quota/dquot.c:469 but task is already holding lock: 00000000874ee741 (&ei->i_data_sem/2){++++}, at: ext4_truncate+0x746/0x1380 fs/ext4/inode.c:4552 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ei->i_data_sem/2){++++}: ext4_map_blocks+0x33e/0x1a50 fs/ext4/inode.c:578 ext4_getblk+0x3f9/0x4f0 fs/ext4/inode.c:993 ext4_bread+0x7c/0x210 fs/ext4/inode.c:1043 ext4_quota_read+0x216/0x2e0 fs/ext4/super.c:5962 find_tree_dqentry+0x77/0x700 fs/quota/quota_tree.c:579 find_tree_dqentry+0x200/0x700 fs/quota/quota_tree.c:590 find_dqentry fs/quota/quota_tree.c:602 [inline] qtree_read_dquot+0x107/0x700 fs/quota/quota_tree.c:622 v2_read_dquot+0xce/0x120 fs/quota/quota_v2.c:334 dquot_acquire+0x121/0x490 fs/quota/dquot.c:428 ext4_acquire_dquot+0x1e7/0x2d0 fs/ext4/super.c:5666 dqget+0x785/0xfc0 fs/quota/dquot.c:896 __dquot_initialize+0x3bd/0xb70 fs/quota/dquot.c:1470 ext4_orphan_cleanup fs/ext4/super.c:2681 [inline] ext4_fill_super+0x8202/0xc850 fs/ext4/super.c:4549 mount_bdev+0x2fc/0x3b0 fs/super.c:1158 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x115c/0x2f50 fs/namespace.c:2822 ksys_mount+0xcf/0x130 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xba/0x150 fs/namespace.c:3049 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&s->s_dquot.dqio_sem){++++}: v2_read_dquot+0x49/0x120 fs/quota/quota_v2.c:333 dquot_acquire+0x121/0x490 fs/quota/dquot.c:428 ext4_acquire_dquot+0x1e7/0x2d0 fs/ext4/super.c:5666 dqget+0x785/0xfc0 fs/quota/dquot.c:896 __dquot_initialize+0x3bd/0xb70 fs/quota/dquot.c:1470 ext4_orphan_cleanup fs/ext4/super.c:2681 [inline] ext4_fill_super+0x8202/0xc850 fs/ext4/super.c:4549 mount_bdev+0x2fc/0x3b0 fs/super.c:1158 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x115c/0x2f50 fs/namespace.c:2822 ksys_mount+0xcf/0x130 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xba/0x150 fs/namespace.c:3049 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&dquot->dq_lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:937 [inline] __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078 dquot_commit+0x4d/0x400 fs/quota/dquot.c:469 ext4_write_dquot+0x1e7/0x280 fs/ext4/super.c:5650 ext4_mark_dquot_dirty+0x111/0x1a0 fs/ext4/super.c:5701 mark_dquot_dirty fs/quota/dquot.c:341 [inline] mark_all_dquot_dirty fs/quota/dquot.c:379 [inline] __dquot_free_space+0x5d4/0x9c0 fs/quota/dquot.c:1887 dquot_free_space_nodirty include/linux/quotaops.h:377 [inline] dquot_free_space include/linux/quotaops.h:382 [inline] dquot_free_block include/linux/quotaops.h:393 [inline] ext4_free_blocks+0x1922/0x2ac0 fs/ext4/mballoc.c:4950 ext4_remove_blocks fs/ext4/extents.c:2584 [inline] ext4_ext_rm_leaf fs/ext4/extents.c:2740 [inline] ext4_ext_remove_space+0x26ef/0x3e80 fs/ext4/extents.c:2973 ext4_ext_truncate+0x1ae/0x200 fs/ext4/extents.c:4670 ext4_truncate+0xe27/0x1380 fs/ext4/inode.c:4557 ext4_orphan_cleanup fs/ext4/super.c:2691 [inline] ext4_fill_super+0x82f7/0xc850 fs/ext4/super.c:4549 mount_bdev+0x2fc/0x3b0 fs/super.c:1158 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x115c/0x2f50 fs/namespace.c:2822 ksys_mount+0xcf/0x130 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xba/0x150 fs/namespace.c:3049 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe 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-executor.4/5386: #0: 00000000b7759e04 (&type->s_umount_key#25/1){+.+.}, at: alloc_super fs/super.c:226 [inline] #0: 00000000b7759e04 (&type->s_umount_key#25/1){+.+.}, at: sget_userns+0x20b/0xcd0 fs/super.c:519 #1: 000000002b31c6e8 (&sb->s_type->i_mutex_key#10){++++}, at: inode_lock include/linux/fs.h:748 [inline] #1: 000000002b31c6e8 (&sb->s_type->i_mutex_key#10){++++}, at: ext4_orphan_cleanup fs/ext4/super.c:2689 [inline] #1: 000000002b31c6e8 (&sb->s_type->i_mutex_key#10){++++}, at: ext4_fill_super+0x82a7/0xc850 fs/ext4/super.c:4549 #2: 00000000874ee741 (&ei->i_data_sem/2){++++}, at: ext4_truncate+0x746/0x1380 fs/ext4/inode.c:4552 #3: 0000000073e2da64 (dquot_srcu){....}, at: i_dquot fs/quota/dquot.c:921 [inline] #3: 0000000073e2da64 (dquot_srcu){....}, at: __dquot_free_space+0x19b/0x9c0 fs/quota/dquot.c:1860 stack backtrace: CPU: 0 PID: 5386 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1222 check_prev_add kernel/locking/lockdep.c:1866 [inline] check_prevs_add kernel/locking/lockdep.c:1979 [inline] validate_chain kernel/locking/lockdep.c:2420 [inline] __lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3416 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 __mutex_lock_common kernel/locking/mutex.c:937 [inline] __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078 dquot_commit+0x4d/0x400 fs/quota/dquot.c:469 ext4_write_dquot+0x1e7/0x280 fs/ext4/super.c:5650 ext4_mark_dquot_dirty+0x111/0x1a0 fs/ext4/super.c:5701 mark_dquot_dirty fs/quota/dquot.c:341 [inline] mark_all_dquot_dirty fs/quota/dquot.c:379 [inline] __dquot_free_space+0x5d4/0x9c0 fs/quota/dquot.c:1887 dquot_free_space_nodirty include/linux/quotaops.h:377 [inline] dquot_free_space include/linux/quotaops.h:382 [inline] dquot_free_block include/linux/quotaops.h:393 [inline] ext4_free_blocks+0x1922/0x2ac0 fs/ext4/mballoc.c:4950 ext4_remove_blocks fs/ext4/extents.c:2584 [inline] ext4_ext_rm_leaf fs/ext4/extents.c:2740 [inline] ext4_ext_remove_space+0x26ef/0x3e80 fs/ext4/extents.c:2973 ext4_ext_truncate+0x1ae/0x200 fs/ext4/extents.c:4670 ext4_truncate+0xe27/0x1380 fs/ext4/inode.c:4557 ext4_orphan_cleanup fs/ext4/super.c:2691 [inline] ext4_fill_super+0x82f7/0xc850 fs/ext4/super.c:4549 mount_bdev+0x2fc/0x3b0 fs/super.c:1158 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x115c/0x2f50 fs/namespace.c:2822 ksys_mount+0xcf/0x130 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xba/0x150 fs/namespace.c:3049 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f257376362a Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2571cd3f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00000000000004bc RCX: 00007f257376362a RDX: 0000000020000040 RSI: 0000000020000500 RDI: 00007f2571cd3fe0 RBP: 00007f2571cd4020 R08: 00007f2571cd4020 R09: 0000000000000004 R10: 0000000000000004 R11: 0000000000000202 R12: 0000000020000040 R13: 0000000020000500 R14: 00007f2571cd3fe0 R15: 0000000020000200 EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop4): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop4): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs warning (device loop5): ext4_enable_quotas:5883: Failed to enable quota tracking (type=1, err=-117). Please run e2fsck to fix. EXT4-fs (loop5): mount failed EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop4): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs warning (device loop5): ext4_enable_quotas:5883: Failed to enable quota tracking (type=1, err=-117). Please run e2fsck to fix. EXT4-fs (loop5): mount failed EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop4): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop4): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs warning (device loop5): ext4_enable_quotas:5883: Failed to enable quota tracking (type=1, err=-117). Please run e2fsck to fix. EXT4-fs (loop5): mount failed __quota_error: 24 callbacks suppressed Quota error (device loop1): find_block_dqentry: Quota for id 0 referenced but not present Quota error (device loop1): qtree_read_dquot: Can't read quota structure for id 0 EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop4): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue Quota error (device loop5): v2_read_file_info: Block with free entry too big (4096 >= 6). EXT4-fs warning (device loop5): ext4_enable_quotas:5883: Failed to enable quota tracking (type=1, err=-117). Please run e2fsck to fix. EXT4-fs (loop5): mount failed EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop4): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue Quota error (device loop1): find_block_dqentry: Quota for id 0 referenced but not present Quota error (device loop1): qtree_read_dquot: Can't read quota structure for id 0 EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue Quota error (device loop5): v2_read_file_info: Block with free entry too big (536870981 >= 6). EXT4-fs warning (device loop5): ext4_enable_quotas:5883: Failed to enable quota tracking (type=1, err=-117). Please run e2fsck to fix. EXT4-fs (loop5): mount failed Quota error (device loop1): find_block_dqentry: Quota for id 0 referenced but not present Quota error (device loop1): qtree_read_dquot: Can't read quota structure for id 0 Quota error (device loop4): find_block_dqentry: Quota for id 0 referenced but not present EXT4-fs (loop1): 1 truncate cleaned up Quota error (device loop4): qtree_read_dquot: Can't read quota structure for id 0 EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop4): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounted filesystem without journal. Opts: nobarrier,noblock_validity,nolazytime,barrier=0x000000007fff0038,data_err=abort,resgid=0x0000000000000000,resuid=0x000000000000ee00,resgid=0x000000000000ee01,resgid=0x000000000000ee002,errors=continue EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop5): 1 truncate cleaned up __quota_error: 28 callbacks suppressed Quota error (device loop1): find_block_dqentry: Quota for id 0 referenced but not present Quota error (device loop1): qtree_read_dquot: Can't read quota structure for id 0 EXT4-fs (loop1): 1 truncate cleaned up Quota error (device loop4): find_block_dqentry: Quota for id 0 referenced but not present Quota error (device loop4): qtree_read_dquot: Can't read quota structure for id 0 EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop5): 1 truncate cleaned up Quota error (device loop4): find_block_dqentry: Quota for id 0 referenced but not present Quota error (device loop4): qtree_read_dquot: Can't read quota structure for id 0 EXT4-fs (loop4): 1 truncate cleaned up Quota error (device loop5): find_block_dqentry: Quota for id 0 referenced but not present Quota error (device loop5): qtree_read_dquot: Can't read quota structure for id 0 EXT4-fs (loop5): 1 truncate cleaned up Quota error (device loop4): find_block_dqentry: Quota for id 0 referenced but not present Quota error (device loop4): qtree_read_dquot: Can't read quota structure for id 0 EXT4-fs (loop4): 1 truncate cleaned up print_req_error: I/O error, dev loop2, sector 0 print_req_error: I/O error, dev loop2, sector 0 Buffer I/O error on dev loop2, logical block 0, async page read