====================================================== WARNING: possible circular locking dependency detected 5.10.45 #1 Not tainted ------------------------------------------------------ syz-executor.3/30976 is trying to acquire lock: ffff88802044db10 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_map_blocks+0x380/0x18d0 fs/ext4/inode.c:560 but task is already holding lock: ffff88806263a1e0 (&s->s_dquot.dqio_sem){++++}-{3:3}, at: v2_write_dquot+0x8b/0x250 fs/quota/quota_v2.c:354 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&s->s_dquot.dqio_sem){++++}-{3:3}: down_read+0x9b/0x420 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:6194 dqget+0x61e/0xf00 fs/quota/dquot.c:901 __dquot_initialize+0x3c3/0xb80 fs/quota/dquot.c:1479 ext4_unlink+0x113/0x840 fs/ext4/namei.c:3262 vfs_unlink+0x2d0/0x610 fs/namei.c:3824 do_unlinkat+0x39b/0x650 fs/namei.c:3888 __do_sys_unlinkat fs/namei.c:3929 [inline] __se_sys_unlinkat fs/namei.c:3922 [inline] __x64_sys_unlinkat+0xbd/0x130 fs/namei.c:3922 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #1 (&dquot->dq_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:969 [inline] __mutex_lock+0x13f/0x1230 kernel/locking/mutex.c:1114 dquot_commit+0x4d/0x380 fs/quota/dquot.c:476 ext4_write_dquot+0x243/0x2f0 fs/ext4/super.c:6178 ext4_mark_dquot_dirty+0x111/0x1a0 fs/ext4/super.c:6229 mark_dquot_dirty fs/quota/dquot.c:347 [inline] mark_all_dquot_dirty fs/quota/dquot.c:385 [inline] __dquot_free_space+0x739/0xa60 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+0x1b2c/0x20c0 fs/ext4/mballoc.c:5502 ext4_remove_blocks fs/ext4/extents.c:2498 [inline] ext4_ext_rm_leaf fs/ext4/extents.c:2664 [inline] ext4_ext_remove_space+0x202d/0x40d0 fs/ext4/extents.c:2912 ext4_ext_truncate+0x1e6/0x240 fs/ext4/extents.c:4373 ext4_truncate+0xd92/0x12b0 fs/ext4/inode.c:4263 ext4_evict_inode+0xa62/0x1a40 fs/ext4/inode.c:287 evict+0x284/0x6b0 fs/inode.c:578 iput_final fs/inode.c:1656 [inline] iput.part.0+0x507/0x780 fs/inode.c:1682 iput+0x58/0x70 fs/inode.c:1672 do_unlinkat+0x3ee/0x650 fs/namei.c:3894 __do_sys_unlinkat fs/namei.c:3929 [inline] __se_sys_unlinkat fs/namei.c:3922 [inline] __x64_sys_unlinkat+0xbd/0x130 fs/namei.c:3922 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #0 (&ei->i_data_sem/2){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:2869 [inline] check_prevs_add kernel/locking/lockdep.c:2994 [inline] validate_chain kernel/locking/lockdep.c:3609 [inline] __lock_acquire+0x2a48/0x5a80 kernel/locking/lockdep.c:4834 lock_acquire kernel/locking/lockdep.c:5444 [inline] lock_acquire+0x197/0x6c0 kernel/locking/lockdep.c:5409 down_read+0x9b/0x420 kernel/locking/rwsem.c:1504 ext4_map_blocks+0x380/0x18d0 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:6538 write_blk+0x10c/0x200 fs/quota/quota_tree.c:73 get_free_dqblk+0xff/0x2d0 fs/quota/quota_tree.c:102 do_insert_tree+0x79c/0x1150 fs/quota/quota_tree.c:309 do_insert_tree+0xf5c/0x1150 fs/quota/quota_tree.c:340 do_insert_tree+0xf5c/0x1150 fs/quota/quota_tree.c:340 do_insert_tree+0xf5c/0x1150 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:6194 dqget+0x61e/0xf00 fs/quota/dquot.c:901 __dquot_initialize+0x3c3/0xb80 fs/quota/dquot.c:1479 ext4_unlink+0x113/0x840 fs/ext4/namei.c:3262 vfs_unlink+0x2d0/0x610 fs/namei.c:3824 do_unlinkat+0x39b/0x650 fs/namei.c:3888 __do_sys_unlinkat fs/namei.c:3929 [inline] __se_sys_unlinkat fs/namei.c:3922 [inline] __x64_sys_unlinkat+0xbd/0x130 fs/namei.c:3922 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: &ei->i_data_sem/2 --> &dquot->dq_lock --> &s->s_dquot.dqio_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&s->s_dquot.dqio_sem); lock(&dquot->dq_lock); lock(&s->s_dquot.dqio_sem); lock(&ei->i_data_sem/2); *** DEADLOCK *** 5 locks held by syz-executor.3/30976: #0: ffff88806263a438 (sb_writers#3){.+.+}-{0:0}, at: do_unlinkat+0x190/0x650 fs/namei.c:3870 #1: ffff888020741838 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:809 [inline] #1: ffff888020741838 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: do_unlinkat+0x27d/0x650 fs/namei.c:3874 #2: ffff8880207435c0 (&sb->s_type->i_mutex_key#13){++++}-{3:3}, at: inode_lock include/linux/fs.h:774 [inline] #2: ffff8880207435c0 (&sb->s_type->i_mutex_key#13){++++}-{3:3}, at: vfs_unlink+0xcd/0x610 fs/namei.c:3815 #3: ffff88804c8bc0a8 (&dquot->dq_lock){+.+.}-{3:3}, at: dquot_acquire+0x54/0x570 fs/quota/dquot.c:432 #4: ffff88806263a1e0 (&s->s_dquot.dqio_sem){++++}-{3:3}, at: v2_write_dquot+0x8b/0x250 fs/quota/quota_v2.c:354 stack backtrace: CPU: 1 PID: 30976 Comm: syz-executor.3 Not tainted 5.10.45 #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+0x25f/0x2e0 kernel/locking/lockdep.c:2118 check_prev_add kernel/locking/lockdep.c:2869 [inline] check_prevs_add kernel/locking/lockdep.c:2994 [inline] validate_chain kernel/locking/lockdep.c:3609 [inline] __lock_acquire+0x2a48/0x5a80 kernel/locking/lockdep.c:4834 lock_acquire kernel/locking/lockdep.c:5444 [inline] lock_acquire+0x197/0x6c0 kernel/locking/lockdep.c:5409 down_read+0x9b/0x420 kernel/locking/rwsem.c:1504 ext4_map_blocks+0x380/0x18d0 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:6538 write_blk+0x10c/0x200 fs/quota/quota_tree.c:73 get_free_dqblk+0xff/0x2d0 fs/quota/quota_tree.c:102 do_insert_tree+0x79c/0x1150 fs/quota/quota_tree.c:309 do_insert_tree+0xf5c/0x1150 fs/quota/quota_tree.c:340 do_insert_tree+0xf5c/0x1150 fs/quota/quota_tree.c:340 do_insert_tree+0xf5c/0x1150 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:6194 dqget+0x61e/0xf00 fs/quota/dquot.c:901 __dquot_initialize+0x3c3/0xb80 fs/quota/dquot.c:1479 ext4_unlink+0x113/0x840 fs/ext4/namei.c:3262 vfs_unlink+0x2d0/0x610 fs/namei.c:3824 do_unlinkat+0x39b/0x650 fs/namei.c:3888 __do_sys_unlinkat fs/namei.c:3929 [inline] __se_sys_unlinkat fs/namei.c:3922 [inline] __x64_sys_unlinkat+0xbd/0x130 fs/namei.c:3922 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:00007f2db7755188 EFLAGS: 00000246 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 0000000000466609 RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000005 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007fffe5b1591f R14: 00007f2db7755300 R15: 0000000000022000 EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir714162327/syzkaller.XQavmr/581/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop3): ext4_free_inode:353: comm syz-executor.3: bit already cleared for inode 13 EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir389237157/syzkaller.fQ8vHH/575/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop6): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir111930563/syzkaller.LnveTU/566/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop7): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir856696813/syzkaller.VYrN0X/573/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop3): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir845059264/syzkaller.NjYaaD/597/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop3): ext4_free_inode:353: comm syz-executor.3: bit already cleared for inode 13 EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir714162327/syzkaller.XQavmr/582/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop1): ext4_free_inode:353: comm syz-executor.1: bit already cleared for inode 13 EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir389237157/syzkaller.fQ8vHH/576/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop4): ext4_free_inode:353: comm syz-executor.4: bit already cleared for inode 13 EXT4-fs (loop6): mounted filesystem without journal. Opts: ,errors=continue EXT4-fs (loop7): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir856696813/syzkaller.VYrN0X/574/file0 supports timestamps until 2038 (0x7fffffff) ext4 filesystem being mounted at /syzkaller-testdir111930563/syzkaller.LnveTU/567/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop6): ext4_free_inode:353: comm syz-executor.6: bit already cleared for inode 13 EXT4-fs error (device loop7): ext4_free_inode:353: comm syz-executor.7: bit already cleared for inode 13 EXT4-fs (loop3): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir845059264/syzkaller.NjYaaD/598/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop3): ext4_free_inode:353: comm syz-executor.3: bit already cleared for inode 13 EXT4-fs warning (device loop2): ext4_multi_mount_protect:324: MMP startup interrupted, failing mount EXT4-fs (loop6): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir111930563/syzkaller.LnveTU/568/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop6): ext4_free_inode:353: comm syz-executor.6: bit already cleared for inode 13 EXT4-fs (loop7): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir856696813/syzkaller.VYrN0X/575/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop3): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir845059264/syzkaller.NjYaaD/599/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop3): ext4_free_inode:353: comm syz-executor.3: bit already cleared for inode 13 EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir714162327/syzkaller.XQavmr/583/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop7): ext4_free_inode:353: comm syz-executor.7: bit already cleared for inode 13 EXT4-fs error (device loop1): ext4_free_inode:353: comm syz-executor.1: bit already cleared for inode 13 EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir389237157/syzkaller.fQ8vHH/577/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop6): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir111930563/syzkaller.LnveTU/569/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop6): ext4_free_inode:353: comm syz-executor.6: bit already cleared for inode 13 EXT4-fs (loop3): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir845059264/syzkaller.NjYaaD/600/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop3): ext4_free_inode:353: comm syz-executor.3: bit already cleared for inode 13 EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir389237157/syzkaller.fQ8vHH/578/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop4): ext4_free_inode:353: comm syz-executor.4: bit already cleared for inode 13 EXT4-fs (loop7): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir856696813/syzkaller.VYrN0X/576/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop7): ext4_free_inode:353: comm syz-executor.7: bit already cleared for inode 13 EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue ext4 filesystem being mounted at /syzkaller-testdir714162327/syzkaller.XQavmr/584/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop1): ext4_free_inode:353: comm syz-executor.1: bit already cleared for inode 13 EXT4-fs warning (device loop2): ext4_multi_mount_protect:324: MMP startup interrupted, failing mount