EXT4-fs warning (device loop4): ext4_empty_dir:2884: inode #12: comm syz-executor.4: directory missing '.' EXT4-fs (loop7): mounted filesystem without journal. Opts: ,errors=continue ====================================================== WARNING: possible circular locking dependency detected 5.10.60 #1 Not tainted ------------------------------------------------------ syz-executor.4/12711 is trying to acquire lock: ffff888043640ea8 (&dquot->dq_lock){+.+.}-{3:3}, at: dquot_commit+0x4d/0x380 fs/quota/dquot.c:476 but task is already holding lock: ffff88801d640c50 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_truncate+0x74b/0x12a0 fs/ext4/inode.c:4258 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+0x9b/0x430 kernel/locking/rwsem.c:1504 ext4_map_blocks+0x380/0x1760 fs/ext4/inode.c:560 ext4_getblk+0x144/0x680 fs/ext4/inode.c:847 ext4_bread+0x29/0x210 fs/ext4/inode.c:899 ext4_quota_write+0x233/0x630 fs/ext4/super.c:6544 write_blk+0x10c/0x200 fs/quota/quota_tree.c:73 get_free_dqblk+0xff/0x2d0 fs/quota/quota_tree.c:102 do_insert_tree+0x787/0x1140 fs/quota/quota_tree.c:309 do_insert_tree+0xf51/0x1140 fs/quota/quota_tree.c:340 do_insert_tree+0x84c/0x1140 fs/quota/quota_tree.c:340 do_insert_tree+0x84c/0x1140 fs/quota/quota_tree.c:340 dq_insert_tree fs/quota/quota_tree.c:366 [inline] qtree_write_dquot+0x3bf/0x580 fs/quota/quota_tree.c:385 v2_write_dquot+0x11c/0x250 fs/quota/quota_v2.c:358 dquot_acquire+0x2cf/0x570 fs/quota/dquot.c:443 ext4_acquire_dquot+0x245/0x350 fs/ext4/super.c:6200 dqget+0x61d/0xf00 fs/quota/dquot.c:901 __dquot_initialize+0x3d7/0xbc0 fs/quota/dquot.c:1479 ext4_rmdir+0x12b/0xf70 fs/ext4/namei.c:3115 vfs_rmdir fs/namei.c:3704 [inline] vfs_rmdir+0x195/0x4d0 fs/namei.c:3683 do_rmdir+0x2c3/0x380 fs/namei.c:3765 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #1 (&s->s_dquot.dqio_sem){++++}-{3:3}: down_read+0x9b/0x430 kernel/locking/rwsem.c:1504 v2_read_dquot+0x49/0x120 fs/quota/quota_v2.c:332 dquot_acquire+0x133/0x570 fs/quota/dquot.c:434 ext4_acquire_dquot+0x245/0x350 fs/ext4/super.c:6200 dqget+0x61d/0xf00 fs/quota/dquot.c:901 __dquot_initialize+0x3d7/0xbc0 fs/quota/dquot.c:1479 ext4_rmdir+0x12b/0xf70 fs/ext4/namei.c:3115 vfs_rmdir fs/namei.c:3704 [inline] vfs_rmdir+0x195/0x4d0 fs/namei.c:3683 do_rmdir+0x2c3/0x380 fs/namei.c:3765 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #0 (&dquot->dq_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:2985 [inline] check_prevs_add kernel/locking/lockdep.c:3110 [inline] validate_chain kernel/locking/lockdep.c:3725 [inline] __lock_acquire+0x29fd/0x5b60 kernel/locking/lockdep.c:4950 lock_acquire kernel/locking/lockdep.c:5560 [inline] lock_acquire+0x197/0x490 kernel/locking/lockdep.c:5525 __mutex_lock_common kernel/locking/mutex.c:969 [inline] __mutex_lock+0x158/0x12e0 kernel/locking/mutex.c:1114 dquot_commit+0x4d/0x380 fs/quota/dquot.c:476 ext4_write_dquot+0x243/0x2f0 fs/ext4/super.c:6184 ext4_mark_dquot_dirty+0x111/0x1a0 fs/ext4/super.c:6235 mark_dquot_dirty fs/quota/dquot.c:347 [inline] mark_all_dquot_dirty fs/quota/dquot.c:385 [inline] __dquot_free_space+0x73c/0xa70 fs/quota/dquot.c:1894 dquot_free_space_nodirty include/linux/quotaops.h:376 [inline] dquot_free_space include/linux/quotaops.h:381 [inline] dquot_free_block include/linux/quotaops.h:392 [inline] ext4_free_blocks+0x1a81/0x20f0 fs/ext4/mballoc.c:5503 ext4_remove_blocks fs/ext4/extents.c:2483 [inline] ext4_ext_rm_leaf fs/ext4/extents.c:2667 [inline] ext4_ext_remove_space+0x308a/0x40c0 fs/ext4/extents.c:2915 ext4_ext_truncate+0x1e6/0x240 fs/ext4/extents.c:4376 ext4_truncate+0xd56/0x12a0 fs/ext4/inode.c:4263 ext4_evict_inode+0xa5b/0x1a70 fs/ext4/inode.c:287 evict+0x284/0x6b0 fs/inode.c:578 iput_final fs/inode.c:1656 [inline] iput.part.0+0x4f0/0x750 fs/inode.c:1682 iput+0x58/0x70 fs/inode.c:1672 dentry_unlink_inode+0x28f/0x3a0 fs/dcache.c:374 d_delete fs/dcache.c:2470 [inline] d_delete+0x16b/0x1c0 fs/dcache.c:2459 vfs_rmdir fs/namei.c:3718 [inline] vfs_rmdir+0x400/0x4d0 fs/namei.c:3683 do_rmdir+0x2c3/0x380 fs/namei.c:3765 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 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 *** 5 locks held by syz-executor.4/12711: #0: ffff888043118438 (sb_writers#3){.+.+}-{0:0}, at: do_rmdir+0x1e2/0x380 fs/namei.c:3749 #1: ffff8880436b0e60 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:809 [inline] #1: ffff8880436b0e60 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: do_rmdir+0x233/0x380 fs/namei.c:3753 #2: ffff888043118628 (sb_internal){.+.+}-{0:0}, at: evict+0x284/0x6b0 fs/inode.c:578 #3: ffff88801d640c50 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_truncate+0x74b/0x12a0 fs/ext4/inode.c:4258 #4: ffffffff84ed2060 (dquot_srcu){....}-{0:0}, at: i_dquot fs/quota/dquot.c:926 [inline] #4: ffffffff84ed2060 (dquot_srcu){....}-{0:0}, at: __dquot_free_space+0x193/0xa70 fs/quota/dquot.c:1867 stack backtrace: CPU: 1 PID: 12711 Comm: syz-executor.4 Not tainted 5.10.60 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:118 check_noncircular+0x268/0x310 kernel/locking/lockdep.c:2120 check_prev_add kernel/locking/lockdep.c:2985 [inline] check_prevs_add kernel/locking/lockdep.c:3110 [inline] validate_chain kernel/locking/lockdep.c:3725 [inline] __lock_acquire+0x29fd/0x5b60 kernel/locking/lockdep.c:4950 lock_acquire kernel/locking/lockdep.c:5560 [inline] lock_acquire+0x197/0x490 kernel/locking/lockdep.c:5525 __mutex_lock_common kernel/locking/mutex.c:969 [inline] __mutex_lock+0x158/0x12e0 kernel/locking/mutex.c:1114 dquot_commit+0x4d/0x380 fs/quota/dquot.c:476 ext4_write_dquot+0x243/0x2f0 fs/ext4/super.c:6184 ext4_mark_dquot_dirty+0x111/0x1a0 fs/ext4/super.c:6235 mark_dquot_dirty fs/quota/dquot.c:347 [inline] mark_all_dquot_dirty fs/quota/dquot.c:385 [inline] __dquot_free_space+0x73c/0xa70 fs/quota/dquot.c:1894 dquot_free_space_nodirty include/linux/quotaops.h:376 [inline] dquot_free_space include/linux/quotaops.h:381 [inline] dquot_free_block include/linux/quotaops.h:392 [inline] ext4_free_blocks+0x1a81/0x20f0 fs/ext4/mballoc.c:5503 ext4_remove_blocks fs/ext4/extents.c:2483 [inline] ext4_ext_rm_leaf fs/ext4/extents.c:2667 [inline] ext4_ext_remove_space+0x308a/0x40c0 fs/ext4/extents.c:2915 ext4_ext_truncate+0x1e6/0x240 fs/ext4/extents.c:4376 ext4_truncate+0xd56/0x12a0 fs/ext4/inode.c:4263 ext4_evict_inode+0xa5b/0x1a70 fs/ext4/inode.c:287 evict+0x284/0x6b0 fs/inode.c:578 iput_final fs/inode.c:1656 [inline] iput.part.0+0x4f0/0x750 fs/inode.c:1682 iput+0x58/0x70 fs/inode.c:1672 dentry_unlink_inode+0x28f/0x3a0 fs/dcache.c:374 d_delete fs/dcache.c:2470 [inline] d_delete+0x16b/0x1c0 fs/dcache.c:2459 vfs_rmdir fs/namei.c:3718 [inline] vfs_rmdir+0x400/0x4d0 fs/namei.c:3683 do_rmdir+0x2c3/0x380 fs/namei.c:3765 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x466609 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2c10a45188 EFLAGS: 00000246 ORIG_RAX: 0000000000000054 RAX: ffffffffffffffda RBX: 000000000056c038 RCX: 0000000000466609 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000040 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c038 R13: 00007ffc4ca7683f R14: 00007f2c10a45300 R15: 0000000000022000 EXT4-fs (loop2): mounted filesystem without journal. Opts: ,errors=continue EXT4-fs (loop5): mounted filesystem without journal. Opts: ,errors=continue EXT4-fs error (device loop5): ext4_empty_dir:2881: inode #12: block 80: comm syz-executor.5: bad entry in directory: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0, size=1024 Quota error (device loop6): v2_read_file_info: Free block number too big (0 >= 0). EXT4-fs warning (device loop6): ext4_enable_quotas:6417: Failed to enable quota tracking (type=1, err=-117). Please run e2fsck to fix. EXT4-fs (loop6): mount failed EXT4-fs warning (device loop5): ext4_empty_dir:2884: inode #12: comm syz-executor.5: directory missing '.' kmemleak: 10 new suspected memory leaks (see /sys/kernel/debug/kmemleak)