ext4 filesystem being mounted at /syzkaller-testdir287178102/syzkaller.8gB3lh/335/file0 supports timestamps until 2038 (0x7fffffff) loop2: detected capacity change from 0 to 512 loop0: detected capacity change from 0 to 512 ====================================================== WARNING: possible circular locking dependency detected 5.16.0-rc6-next-20211224 #1 Not tainted ------------------------------------------------------ syz-executor.6/18156 is trying to acquire lock: ffff88801f60dac8 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_map_blocks+0x380/0x18d0 fs/ext4/inode.c:561 but task is already holding lock: ffff888017a281e0 (&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+0x98/0x440 kernel/locking/rwsem.c:1461 v2_read_dquot+0x49/0x120 fs/quota/quota_v2.c:332 dquot_acquire+0x133/0x570 fs/quota/dquot.c:432 ext4_acquire_dquot+0x240/0x340 fs/ext4/super.c:6645 dqget+0x623/0xf10 fs/quota/dquot.c:899 __dquot_initialize+0x3c3/0xb80 fs/quota/dquot.c:1477 ext4_xattr_set+0xbd/0x340 fs/ext4/xattr.c:2464 __vfs_setxattr+0x115/0x180 fs/xattr.c:180 __vfs_setxattr_noperm+0x125/0x5f0 fs/xattr.c:214 __vfs_setxattr_locked+0x1cf/0x260 fs/xattr.c:275 vfs_setxattr+0x13f/0x330 fs/xattr.c:301 setxattr+0x218/0x2b0 fs/xattr.c:575 path_setxattr+0x197/0x1c0 fs/xattr.c:595 __do_sys_lsetxattr fs/xattr.c:618 [inline] __se_sys_lsetxattr fs/xattr.c:614 [inline] __x64_sys_lsetxattr+0xbd/0x150 fs/xattr.c:614 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #1 (&dquot->dq_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:600 [inline] __mutex_lock+0x136/0x1480 kernel/locking/mutex.c:733 dquot_commit+0x4d/0x380 fs/quota/dquot.c:474 ext4_write_dquot+0x243/0x2f0 fs/ext4/super.c:6629 ext4_mark_dquot_dirty fs/ext4/super.c:6677 [inline] ext4_mark_dquot_dirty+0x111/0x1b0 fs/ext4/super.c:6671 mark_dquot_dirty fs/quota/dquot.c:345 [inline] mark_all_dquot_dirty fs/quota/dquot.c:383 [inline] __dquot_alloc_space+0x5d5/0xb50 fs/quota/dquot.c:1707 dquot_alloc_space_nodirty include/linux/quotaops.h:297 [inline] dquot_alloc_space include/linux/quotaops.h:310 [inline] dquot_alloc_block include/linux/quotaops.h:334 [inline] ext4_mb_new_blocks+0x5c5/0x4a00 fs/ext4/mballoc.c:5548 ext4_alloc_branch fs/ext4/indirect.c:333 [inline] ext4_ind_map_blocks+0x1a0f/0x2330 fs/ext4/indirect.c:628 ext4_map_blocks+0x9c7/0x18d0 fs/ext4/inode.c:640 ext4_getblk+0x144/0x6b0 fs/ext4/inode.c:848 ext4_bread+0x2a/0x1c0 fs/ext4/inode.c:901 ext4_add_entry+0xa2e/0xc30 fs/ext4/namei.c:2352 ext4_add_nondir+0x90/0x290 fs/ext4/namei.c:2709 ext4_create+0x386/0x4e0 fs/ext4/namei.c:2754 lookup_open.isra.0+0x105a/0x1590 fs/namei.c:3330 open_last_lookups fs/namei.c:3400 [inline] path_openat+0x9ae/0x28a0 fs/namei.c:3606 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4d0 fs/open.c:1214 do_sys_open fs/open.c:1230 [inline] __do_sys_openat fs/open.c:1246 [inline] __se_sys_openat fs/open.c:1241 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1241 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #0 (&ei->i_data_sem/2){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3063 [inline] check_prevs_add kernel/locking/lockdep.c:3186 [inline] validate_chain kernel/locking/lockdep.c:3801 [inline] __lock_acquire+0x2a14/0x5b70 kernel/locking/lockdep.c:5027 lock_acquire kernel/locking/lockdep.c:5639 [inline] lock_acquire+0x1a2/0x4d0 kernel/locking/lockdep.c:5604 down_read+0x98/0x440 kernel/locking/rwsem.c:1461 ext4_map_blocks+0x380/0x18d0 fs/ext4/inode.c:561 ext4_getblk+0x144/0x6b0 fs/ext4/inode.c:848 ext4_bread+0x2a/0x1c0 fs/ext4/inode.c:901 ext4_quota_write+0x237/0x640 fs/ext4/super.c:6976 write_blk+0x10c/0x200 fs/quota/quota_tree.c:64 get_free_dqblk+0x104/0x2c0 fs/quota/quota_tree.c:93 do_insert_tree+0x63a/0x11d0 fs/quota/quota_tree.c:300 do_insert_tree+0xd71/0x11d0 fs/quota/quota_tree.c:331 do_insert_tree+0x6fd/0x11d0 fs/quota/quota_tree.c:331 do_insert_tree+0x6fd/0x11d0 fs/quota/quota_tree.c:331 dq_insert_tree fs/quota/quota_tree.c:357 [inline] qtree_write_dquot+0x3b8/0x580 fs/quota/quota_tree.c:376 v2_write_dquot+0x11c/0x250 fs/quota/quota_v2.c:358 dquot_acquire+0x2cf/0x570 fs/quota/dquot.c:441 ext4_acquire_dquot+0x240/0x340 fs/ext4/super.c:6645 dqget+0x623/0xf10 fs/quota/dquot.c:899 __dquot_initialize+0x3c3/0xb80 fs/quota/dquot.c:1477 ext4_create+0x90/0x4e0 fs/ext4/namei.c:2739 lookup_open.isra.0+0x105a/0x1590 fs/namei.c:3330 open_last_lookups fs/namei.c:3400 [inline] path_openat+0x9ae/0x28a0 fs/namei.c:3606 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4d0 fs/open.c:1214 do_sys_open fs/open.c:1230 [inline] __do_sys_openat fs/open.c:1246 [inline] __se_sys_openat fs/open.c:1241 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1241 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae 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 *** 4 locks held by syz-executor.6/18156: #0: ffff888017a28438 (sb_writers#3){.+.+}-{0:0}, at: open_last_lookups fs/namei.c:3389 [inline] #0: ffff888017a28438 (sb_writers#3){.+.+}-{0:0}, at: path_openat+0x2676/0x28a0 fs/namei.c:3606 #1: ffff88801f60a160 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: inode_lock include/linux/fs.h:777 [inline] #1: ffff88801f60a160 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: open_last_lookups fs/namei.c:3397 [inline] #1: ffff88801f60a160 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: path_openat+0x948/0x28a0 fs/namei.c:3606 #2: ffff88801f586b28 (&dquot->dq_lock){+.+.}-{3:3}, at: dquot_acquire+0x54/0x570 fs/quota/dquot.c:430 #3: ffff888017a281e0 (&s->s_dquot.dqio_sem){++++}-{3:3}, at: v2_write_dquot+0x8b/0x250 fs/quota/quota_v2.c:354 stack backtrace: CPU: 1 PID: 18156 Comm: syz-executor.6 Not tainted 5.16.0-rc6-next-20211224 #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:88 [inline] dump_stack_lvl+0x8b/0xb3 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2143 check_prev_add kernel/locking/lockdep.c:3063 [inline] check_prevs_add kernel/locking/lockdep.c:3186 [inline] validate_chain kernel/locking/lockdep.c:3801 [inline] __lock_acquire+0x2a14/0x5b70 kernel/locking/lockdep.c:5027 lock_acquire kernel/locking/lockdep.c:5639 [inline] lock_acquire+0x1a2/0x4d0 kernel/locking/lockdep.c:5604 down_read+0x98/0x440 kernel/locking/rwsem.c:1461 ext4_map_blocks+0x380/0x18d0 fs/ext4/inode.c:561 ext4_getblk+0x144/0x6b0 fs/ext4/inode.c:848 ext4_bread+0x2a/0x1c0 fs/ext4/inode.c:901 ext4_quota_write+0x237/0x640 fs/ext4/super.c:6976 write_blk+0x10c/0x200 fs/quota/quota_tree.c:64 get_free_dqblk+0x104/0x2c0 fs/quota/quota_tree.c:93 do_insert_tree+0x63a/0x11d0 fs/quota/quota_tree.c:300 do_insert_tree+0xd71/0x11d0 fs/quota/quota_tree.c:331 do_insert_tree+0x6fd/0x11d0 fs/quota/quota_tree.c:331 do_insert_tree+0x6fd/0x11d0 fs/quota/quota_tree.c:331 dq_insert_tree fs/quota/quota_tree.c:357 [inline] qtree_write_dquot+0x3b8/0x580 fs/quota/quota_tree.c:376 v2_write_dquot+0x11c/0x250 fs/quota/quota_v2.c:358 dquot_acquire+0x2cf/0x570 fs/quota/dquot.c:441 ext4_acquire_dquot+0x240/0x340 fs/ext4/super.c:6645 dqget+0x623/0xf10 fs/quota/dquot.c:899 __dquot_initialize+0x3c3/0xb80 fs/quota/dquot.c:1477 ext4_create+0x90/0x4e0 fs/ext4/namei.c:2739 lookup_open.isra.0+0x105a/0x1590 fs/namei.c:3330 open_last_lookups fs/namei.c:3400 [inline] path_openat+0x9ae/0x28a0 fs/namei.c:3606 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4d0 fs/open.c:1214 do_sys_open fs/open.c:1230 [inline] __do_sys_openat fs/open.c:1246 [inline] __se_sys_openat fs/open.c:1241 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1241 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f89ba0e1b19 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:00007f89b7657188 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f89ba1f4f60 RCX: 00007f89ba0e1b19 RDX: 0000000000000040 RSI: 0000000020000040 RDI: 0000000000000005 RBP: 00007f89ba13bf6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc1e330b3f R14: 00007f89b7657300 R15: 0000000000022000 EXT4-fs (loop5): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir134293529/syzkaller.jZf845/392/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop1): mounted filesystem without journal. Quota mode: writeback. EXT4-fs (loop4): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir290909860/syzkaller.kyzGRa/335/file0 supports timestamps until 2038 (0x7fffffff) ext4 filesystem being mounted at /syzkaller-testdir187392716/syzkaller.BOw1XF/243/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop7): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir463960157/syzkaller.iKXWfn/343/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop3): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir446815969/syzkaller.VIgvjE/334/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs error (device loop2): __ext4_fill_super:5273: inode #2: comm syz-executor.2: iget: root inode unallocated EXT4-fs (loop2): get root inode failed EXT4-fs (loop2): mount failed EXT4-fs (loop0): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir851443110/syzkaller.qUQeUI/339/file0 supports timestamps until 2038 (0x7fffffff) loop5: detected capacity change from 0 to 512 loop4: detected capacity change from 0 to 512 loop3: detected capacity change from 0 to 512 loop1: detected capacity change from 0 to 512 loop7: detected capacity change from 0 to 512 EXT4-fs (loop3): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir446815969/syzkaller.VIgvjE/335/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop5): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir134293529/syzkaller.jZf845/393/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop7): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir463960157/syzkaller.iKXWfn/344/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop4): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir290909860/syzkaller.kyzGRa/336/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop1): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir187392716/syzkaller.BOw1XF/244/file0 supports timestamps until 2038 (0x7fffffff) loop3: detected capacity change from 0 to 512 loop5: detected capacity change from 0 to 512 loop7: detected capacity change from 0 to 512 loop1: detected capacity change from 0 to 512 loop0: detected capacity change from 0 to 512 loop2: detected capacity change from 0 to 512 loop4: detected capacity change from 0 to 512 loop6: detected capacity change from 0 to 512 EXT4-fs (loop5): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir134293529/syzkaller.jZf845/394/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop1): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir187392716/syzkaller.BOw1XF/245/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop3): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir446815969/syzkaller.VIgvjE/336/file0 supports timestamps until 2038 (0x7fffffff) EXT4-fs (loop7): mounted filesystem without journal. Quota mode: writeback. ext4 filesystem being mounted at /syzkaller-testdir463960157/syzkaller.iKXWfn/345/file0 supports timestamps until 2038 (0x7fffffff)