EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem 00000000-0000-0000-0000-000000000000 without journal. Quota mode: writeback. ====================================================== WARNING: possible circular locking dependency detected 6.3.0-rc2-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/12363 is trying to acquire lock: ffffffff8c8e2040 (fs_reclaim){+.+.}-{0:0}, at: might_alloc include/linux/sched/mm.h:271 [inline] ffffffff8c8e2040 (fs_reclaim){+.+.}-{0:0}, at: slab_pre_alloc_hook mm/slab.h:728 [inline] ffffffff8c8e2040 (fs_reclaim){+.+.}-{0:0}, at: slab_alloc_node mm/slab.c:3241 [inline] ffffffff8c8e2040 (fs_reclaim){+.+.}-{0:0}, at: __kmem_cache_alloc_node+0x3b/0x3f0 mm/slab.c:3541 but task is already holding lock: ffff88802a8aa0c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] ffff88802a8aa0c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6000 [inline] ffff88802a8aa0c8 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x48f/0x8f0 fs/ext4/inode.c:6081 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ei->xattr_sem){++++}-{3:3}: down_write+0x92/0x200 kernel/locking/rwsem.c:1573 ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline] ext4_inline_data_truncate+0x1a8/0xd70 fs/ext4/inline.c:1932 ext4_truncate+0x992/0x1520 fs/ext4/inode.c:4298 ext4_evict_inode+0xace/0x1ac0 fs/ext4/inode.c:286 evict+0x2ed/0x6b0 fs/inode.c:665 iput_final fs/inode.c:1748 [inline] iput.part.0+0x55d/0x830 fs/inode.c:1774 iput+0x5c/0x80 fs/inode.c:1764 do_unlinkat+0x42e/0x670 fs/namei.c:4323 __do_sys_unlinkat fs/namei.c:4359 [inline] __se_sys_unlinkat fs/namei.c:4352 [inline] __x64_sys_unlinkat+0xc1/0x130 fs/namei.c:4352 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (sb_internal){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1477 [inline] sb_start_intwrite include/linux/fs.h:1599 [inline] ext4_evict_inode+0xf52/0x1ac0 fs/ext4/inode.c:240 evict+0x2ed/0x6b0 fs/inode.c:665 iput_final fs/inode.c:1748 [inline] iput.part.0+0x55d/0x830 fs/inode.c:1774 iput+0x5c/0x80 fs/inode.c:1764 dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:401 __dentry_kill+0x3c0/0x640 fs/dcache.c:607 shrink_dentry_list+0x12c/0x4f0 fs/dcache.c:1201 prune_dcache_sb+0xeb/0x150 fs/dcache.c:1282 super_cache_scan+0x33a/0x590 fs/super.c:104 do_shrink_slab+0x428/0xc00 mm/vmscan.c:853 shrink_slab+0x175/0x660 mm/vmscan.c:1013 shrink_one+0x502/0x810 mm/vmscan.c:5343 shrink_many mm/vmscan.c:5394 [inline] lru_gen_shrink_node mm/vmscan.c:5511 [inline] shrink_node+0x2064/0x35f0 mm/vmscan.c:6459 kswapd_shrink_node mm/vmscan.c:7262 [inline] balance_pgdat+0xa02/0x1ac0 mm/vmscan.c:7452 kswapd+0x677/0xec0 mm/vmscan.c:7712 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 -> #0 (fs_reclaim){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1af/0x5b0 kernel/locking/lockdep.c:5634 __fs_reclaim_acquire mm/page_alloc.c:4716 [inline] fs_reclaim_acquire+0x11d/0x160 mm/page_alloc.c:4730 might_alloc include/linux/sched/mm.h:271 [inline] slab_pre_alloc_hook mm/slab.h:728 [inline] slab_alloc_node mm/slab.c:3241 [inline] __kmem_cache_alloc_node+0x3b/0x3f0 mm/slab.c:3541 __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc_node+0x4d/0xd0 mm/slab_common.c:974 kmalloc_node include/linux/slab.h:610 [inline] kvmalloc_node+0xa2/0x1a0 mm/util.c:603 kvmalloc include/linux/slab.h:737 [inline] ext4_xattr_inode_cache_find fs/ext4/xattr.c:1552 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1595 [inline] ext4_xattr_set_entry+0x1d82/0x39e0 fs/ext4/xattr.c:1737 ext4_xattr_block_set+0x618/0x3030 fs/ext4/xattr.c:1974 ext4_xattr_move_to_block fs/ext4/xattr.c:2668 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2743 [inline] ext4_expand_extra_isize_ea+0xa84/0x1880 fs/ext4/xattr.c:2835 __ext4_expand_extra_isize+0x33e/0x470 fs/ext4/inode.c:5960 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6003 [inline] __ext4_mark_inode_dirty+0x51b/0x8f0 fs/ext4/inode.c:6081 __ext4_unlink+0x667/0xcd0 fs/ext4/namei.c:3269 ext4_unlink+0x41f/0x760 fs/ext4/namei.c:3298 vfs_unlink+0x355/0x930 fs/namei.c:4250 do_unlinkat+0x3df/0x670 fs/namei.c:4316 __do_sys_unlinkat fs/namei.c:4359 [inline] __se_sys_unlinkat fs/namei.c:4352 [inline] __x64_sys_unlinkat+0xc1/0x130 fs/namei.c:4352 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: fs_reclaim --> sb_internal --> &ei->xattr_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->xattr_sem); lock(sb_internal); lock(&ei->xattr_sem); lock(fs_reclaim); *** DEADLOCK *** 4 locks held by syz-executor.1/12363: #0: ffff888024694460 (sb_writers#5){.+.+}-{0:0}, at: do_unlinkat+0x18c/0x670 fs/namei.c:4297 #1: ffff888028f4c780 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #1: ffff888028f4c780 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: do_unlinkat+0x27c/0x670 fs/namei.c:4301 #2: ffff88802a8aa400 (&sb->s_type->i_mutex_key#7){++++}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #2: ffff88802a8aa400 (&sb->s_type->i_mutex_key#7){++++}-{3:3}, at: vfs_unlink+0xd9/0x930 fs/namei.c:4239 #3: ffff88802a8aa0c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] #3: ffff88802a8aa0c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6000 [inline] #3: ffff88802a8aa0c8 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x48f/0x8f0 fs/ext4/inode.c:6081 stack backtrace: CPU: 0 PID: 12363 Comm: syz-executor.1 Not tainted 6.3.0-rc2-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1af/0x5b0 kernel/locking/lockdep.c:5634 __fs_reclaim_acquire mm/page_alloc.c:4716 [inline] fs_reclaim_acquire+0x11d/0x160 mm/page_alloc.c:4730 might_alloc include/linux/sched/mm.h:271 [inline] slab_pre_alloc_hook mm/slab.h:728 [inline] slab_alloc_node mm/slab.c:3241 [inline] __kmem_cache_alloc_node+0x3b/0x3f0 mm/slab.c:3541 __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc_node+0x4d/0xd0 mm/slab_common.c:974 kmalloc_node include/linux/slab.h:610 [inline] kvmalloc_node+0xa2/0x1a0 mm/util.c:603 kvmalloc include/linux/slab.h:737 [inline] ext4_xattr_inode_cache_find fs/ext4/xattr.c:1552 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1595 [inline] ext4_xattr_set_entry+0x1d82/0x39e0 fs/ext4/xattr.c:1737 ext4_xattr_block_set+0x618/0x3030 fs/ext4/xattr.c:1974 ext4_xattr_move_to_block fs/ext4/xattr.c:2668 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2743 [inline] ext4_expand_extra_isize_ea+0xa84/0x1880 fs/ext4/xattr.c:2835 __ext4_expand_extra_isize+0x33e/0x470 fs/ext4/inode.c:5960 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6003 [inline] __ext4_mark_inode_dirty+0x51b/0x8f0 fs/ext4/inode.c:6081 __ext4_unlink+0x667/0xcd0 fs/ext4/namei.c:3269 ext4_unlink+0x41f/0x760 fs/ext4/namei.c:3298 vfs_unlink+0x355/0x930 fs/namei.c:4250 do_unlinkat+0x3df/0x670 fs/namei.c:4316 __do_sys_unlinkat fs/namei.c:4359 [inline] __se_sys_unlinkat fs/namei.c:4352 [inline] __x64_sys_unlinkat+0xc1/0x130 fs/namei.c:4352 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0aad48c0f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0aae255168 EFLAGS: 00000246 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 00007f0aad5abf80 RCX: 00007f0aad48c0f9 RDX: 0000000000000000 RSI: 00000000200003c0 RDI: ffffffffffffff9c RBP: 00007f0aad4e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe13c1c4ff R14: 00007f0aae255300 R15: 0000000000022000