====================================================== WARNING: possible circular locking dependency detected 5.10.56 #1 Not tainted ------------------------------------------------------ syz-executor.2/13078 is trying to acquire lock: ffff88804e6ef928 (&dquot->dq_lock){+.+.}-{3:3}, at: dquot_commit+0x4d/0x380 fs/quota/dquot.c:476 but task is already holding lock: ffff888054daa9d8 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_map_blocks+0x5e0/0x18d0 fs/ext4/inode.c:630 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/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: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+0x79c/0x1150 fs/quota/quota_tree.c:309 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:6200 dqget+0x61e/0xf00 fs/quota/dquot.c:901 __dquot_initialize+0x3c3/0xb80 fs/quota/dquot.c:1479 ext4_setattr+0x3ae/0x2220 fs/ext4/inode.c:5349 notify_change+0xb9e/0x1080 fs/attr.c:336 chown_common+0x30a/0x500 fs/open.c:674 do_fchownat+0x126/0x1e0 fs/open.c:704 __do_sys_lchown fs/open.c:729 [inline] __se_sys_lchown fs/open.c:727 [inline] __x64_sys_lchown+0x7a/0xc0 fs/open.c:727 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/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:6200 dqget+0x61e/0xf00 fs/quota/dquot.c:901 __dquot_initialize+0x3c3/0xb80 fs/quota/dquot.c:1479 ext4_setattr+0x3ae/0x2220 fs/ext4/inode.c:5349 notify_change+0xb9e/0x1080 fs/attr.c:336 chown_common+0x30a/0x500 fs/open.c:674 do_fchownat+0x126/0x1e0 fs/open.c:704 __do_sys_lchown fs/open.c:729 [inline] __se_sys_lchown fs/open.c:727 [inline] __x64_sys_lchown+0x7a/0xc0 fs/open.c:727 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+0x29f6/0x5b20 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+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: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_alloc_space+0x5d5/0xb50 fs/quota/dquot.c:1709 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+0x5c7/0x46d0 fs/ext4/mballoc.c:4968 ext4_ext_map_blocks+0x1ec0/0x5c10 fs/ext4/extents.c:4244 ext4_map_blocks+0x652/0x18d0 fs/ext4/inode.c:637 _ext4_get_block+0x21a/0x570 fs/ext4/inode.c:793 __block_write_begin_int+0x3d1/0x1a50 fs/buffer.c:2011 ext4_convert_inline_data_to_extent fs/ext4/inline.c:593 [inline] ext4_try_to_write_inline_data+0x725/0x14c0 fs/ext4/inline.c:725 ext4_write_begin+0xb9c/0x10e0 fs/ext4/inode.c:1158 ext4_da_write_begin+0x623/0xde0 fs/ext4/inode.c:2961 generic_perform_write+0x1fe/0x4d0 mm/filemap.c:3333 ext4_buffered_write_iter+0x244/0x4d0 fs/ext4/file.c:270 ext4_file_write_iter+0x4ee/0x1890 fs/ext4/file.c:681 call_write_iter include/linux/fs.h:1903 [inline] do_iter_readv_writev+0x476/0x750 fs/read_write.c:740 do_iter_write+0x18d/0x670 fs/read_write.c:866 vfs_iter_write+0x70/0xa0 fs/read_write.c:907 iter_file_splice_write+0x71d/0xbe0 fs/splice.c:686 do_splice_from fs/splice.c:764 [inline] direct_splice_actor+0x10f/0x170 fs/splice.c:933 splice_direct_to_actor+0x387/0x980 fs/splice.c:888 do_splice_direct+0x1c4/0x290 fs/splice.c:976 generic_copy_file_range fs/read_write.c:1386 [inline] do_copy_file_range fs/read_write.c:1409 [inline] vfs_copy_file_range+0x57b/0x10f0 fs/read_write.c:1516 __do_sys_copy_file_range+0x176/0x410 fs/read_write.c:1569 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.2/13078: #0: ffff8880466aa438 (sb_writers#3){.+.+}-{0:0}, at: __do_sys_copy_file_range+0x176/0x410 fs/read_write.c:1569 #1: ffff888054daabe8 (&sb->s_type->i_mutex_key#13){++++}-{3:3}, at: inode_lock include/linux/fs.h:774 [inline] #1: ffff888054daabe8 (&sb->s_type->i_mutex_key#13){++++}-{3:3}, at: ext4_buffered_write_iter+0xb6/0x4d0 fs/ext4/file.c:264 #2: ffff888054daa828 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_lock_xattr fs/ext4/xattr.h:142 [inline] #2: ffff888054daa828 (&ei->xattr_sem){++++}-{3:3}, at: ext4_convert_inline_data_to_extent fs/ext4/inline.c:569 [inline] #2: ffff888054daa828 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_write_inline_data+0x2fc/0x14c0 fs/ext4/inline.c:725 #3: ffff888054daa9d8 (&ei->i_data_sem/2){++++}-{3:3}, at: ext4_map_blocks+0x5e0/0x18d0 fs/ext4/inode.c:630 #4: ffffffff84ed1e20 (dquot_srcu){....}-{0:0}, at: i_dquot fs/quota/dquot.c:926 [inline] #4: ffffffff84ed1e20 (dquot_srcu){....}-{0:0}, at: __dquot_alloc_space+0x1af/0xb50 fs/quota/dquot.c:1671 stack backtrace: CPU: 0 PID: 13078 Comm: syz-executor.2 Not tainted 5.10.56 #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: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+0x29f6/0x5b20 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+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: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_alloc_space+0x5d5/0xb50 fs/quota/dquot.c:1709 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+0x5c7/0x46d0 fs/ext4/mballoc.c:4968 ext4_ext_map_blocks+0x1ec0/0x5c10 fs/ext4/extents.c:4244 ext4_map_blocks+0x652/0x18d0 fs/ext4/inode.c:637 _ext4_get_block+0x21a/0x570 fs/ext4/inode.c:793 __block_write_begin_int+0x3d1/0x1a50 fs/buffer.c:2011 ext4_convert_inline_data_to_extent fs/ext4/inline.c:593 [inline] ext4_try_to_write_inline_data+0x725/0x14c0 fs/ext4/inline.c:725 ext4_write_begin+0xb9c/0x10e0 fs/ext4/inode.c:1158 ext4_da_write_begin+0x623/0xde0 fs/ext4/inode.c:2961 generic_perform_write+0x1fe/0x4d0 mm/filemap.c:3333 ext4_buffered_write_iter+0x244/0x4d0 fs/ext4/file.c:270 ext4_file_write_iter+0x4ee/0x1890 fs/ext4/file.c:681 call_write_iter include/linux/fs.h:1903 [inline] do_iter_readv_writev+0x476/0x750 fs/read_write.c:740 do_iter_write+0x18d/0x670 fs/read_write.c:866 vfs_iter_write+0x70/0xa0 fs/read_write.c:907 iter_file_splice_write+0x71d/0xbe0 fs/splice.c:686 do_splice_from fs/splice.c:764 [inline] direct_splice_actor+0x10f/0x170 fs/splice.c:933 splice_direct_to_actor+0x387/0x980 fs/splice.c:888 do_splice_direct+0x1c4/0x290 fs/splice.c:976 generic_copy_file_range fs/read_write.c:1386 [inline] do_copy_file_range fs/read_write.c:1409 [inline] vfs_copy_file_range+0x57b/0x10f0 fs/read_write.c:1516 __do_sys_copy_file_range+0x176/0x410 fs/read_write.c:1569 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:00007f50cfa68188 EFLAGS: 00000246 ORIG_RAX: 0000000000000146 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 0000000000466609 RDX: 0000000000000003 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00000000004bfcb9 R08: 000000000200f5ef R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffffdba8e7f R14: 00007f50cfa68300 R15: 0000000000022000 hpet: Lost 8 RTC interrupts syz-executor.2 (13078) used greatest stack depth: 22424 bytes left