EXT4-fs (loop6): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback. ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.6.32/7046 is trying to acquire lock: ffff88817c260400 (&ea_inode->i_rwsem#8/1){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:771 [inline] ffff88817c260400 (&ea_inode->i_rwsem#8/1){+.+.}-{4:4}, at: ext4_xattr_inode_iget+0xcc/0x1b0 fs/ext4/xattr.c:461 but task is already holding lock: ffff88817c263b28 (&ei->i_data_sem/3){++++}-{4:4}, at: ext4_truncate+0x385/0x7c0 fs/ext4/inode.c:4148 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ei->i_data_sem/3){++++}-{4:4}: down_write+0x29/0xc0 kernel/locking/rwsem.c:1573 ext4_update_i_disksize fs/ext4/ext4.h:3310 [inline] ext4_xattr_inode_write fs/ext4/xattr.c:1446 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1594 [inline] ext4_xattr_set_entry+0x1790/0x1980 fs/ext4/xattr.c:1719 ext4_xattr_ibody_set+0x83/0x120 fs/ext4/xattr.c:2273 ext4_xattr_set_handle+0x3ed/0xa20 fs/ext4/xattr.c:2430 ext4_xattr_set+0xa2/0x1f0 fs/ext4/xattr.c:2544 __vfs_setxattr+0xfc/0x130 fs/xattr.c:201 __vfs_setxattr_noperm+0xa7/0x300 fs/xattr.c:235 __vfs_setxattr_locked+0x127/0x180 fs/xattr.c:296 vfs_setxattr+0xcf/0x230 fs/xattr.c:322 do_setxattr+0xcb/0xd0 fs/xattr.c:630 setxattr+0xd4/0xf0 fs/xattr.c:653 path_setxattr+0x12c/0x150 fs/xattr.c:672 __do_sys_setxattr fs/xattr.c:688 [inline] __se_sys_setxattr fs/xattr.c:684 [inline] __x64_sys_setxattr+0x2c/0x40 fs/xattr.c:684 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x6f/0xd9 -> #0 (&ea_inode->i_rwsem#8/1){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3113 [inline] check_prevs_add kernel/locking/lockdep.c:3232 [inline] validate_chain kernel/locking/lockdep.c:3847 [inline] __lock_acquire+0x13fd/0x1c00 kernel/locking/lockdep.c:5088 lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0xcd/0x2c0 kernel/locking/lockdep.c:5670 down_write+0x29/0xc0 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:771 [inline] ext4_xattr_inode_iget+0xcc/0x1b0 fs/ext4/xattr.c:461 ext4_xattr_inode_get+0x66/0x3d0 fs/ext4/xattr.c:535 ext4_xattr_move_to_block fs/ext4/xattr.c:2626 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2728 [inline] ext4_expand_extra_isize_ea+0x99b/0xda0 fs/ext4/xattr.c:2820 __ext4_expand_extra_isize+0x195/0x200 fs/ext4/inode.c:5795 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5838 [inline] __ext4_mark_inode_dirty+0x298/0x3c0 fs/ext4/inode.c:5916 ext4_ext_truncate+0x3d/0x140 fs/ext4/extents.c:4400 ext4_truncate+0x3c1/0x7c0 fs/ext4/inode.c:4153 ext4_setattr+0xc89/0x10b0 fs/ext4/inode.c:5460 notify_change+0x3f5/0x8b0 fs/attr.c:483 do_truncate+0xd8/0x130 fs/open.c:66 vfs_truncate+0x1fc/0x240 fs/open.c:112 do_sys_truncate+0x101/0x130 fs/open.c:135 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x6f/0xd9 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem/3); lock(&ea_inode->i_rwsem#8/1); lock(&ei->i_data_sem/3); lock(&ea_inode->i_rwsem#8/1); *** DEADLOCK *** 5 locks held by syz.6.32/7046: #0: ffff888101b50438 (sb_writers#4){.+.+}-{0:0}, at: vfs_truncate+0x6c/0x240 fs/open.c:85 #1: ffff88817c263ca0 (&sb->s_type->i_mutex_key#8){++++}-{4:4}, at: inode_lock include/linux/fs.h:771 [inline] #1: ffff88817c263ca0 (&sb->s_type->i_mutex_key#8){++++}-{4:4}, at: do_truncate+0xc8/0x130 fs/open.c:64 #2: ffff88817c263e40 (mapping.invalidate_lock){++++}-{4:4}, at: filemap_invalidate_lock include/linux/fs.h:816 [inline] #2: ffff88817c263e40 (mapping.invalidate_lock){++++}-{4:4}, at: ext4_setattr+0x684/0x10b0 fs/ext4/inode.c:5383 #3: ffff88817c263b28 (&ei->i_data_sem/3){++++}-{4:4}, at: ext4_truncate+0x385/0x7c0 fs/ext4/inode.c:4148 #4: ffff88817c263968 (&ei->xattr_sem){++++}-{4:4}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] #4: ffff88817c263968 (&ei->xattr_sem){++++}-{4:4}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:5835 [inline] #4: ffff88817c263968 (&ei->xattr_sem){++++}-{4:4}, at: __ext4_mark_inode_dirty+0x24d/0x3c0 fs/ext4/inode.c:5916 stack backtrace: CPU: 0 PID: 7046 Comm: syz.6.32 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0xf8/0x110 kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3113 [inline] check_prevs_add kernel/locking/lockdep.c:3232 [inline] validate_chain kernel/locking/lockdep.c:3847 [inline] __lock_acquire+0x13fd/0x1c00 kernel/locking/lockdep.c:5088 lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0xcd/0x2c0 kernel/locking/lockdep.c:5670 down_write+0x29/0xc0 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:771 [inline] ext4_xattr_inode_iget+0xcc/0x1b0 fs/ext4/xattr.c:461 ext4_xattr_inode_get+0x66/0x3d0 fs/ext4/xattr.c:535 ext4_xattr_move_to_block fs/ext4/xattr.c:2626 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2728 [inline] ext4_expand_extra_isize_ea+0x99b/0xda0 fs/ext4/xattr.c:2820 __ext4_expand_extra_isize+0x195/0x200 fs/ext4/inode.c:5795 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5838 [inline] __ext4_mark_inode_dirty+0x298/0x3c0 fs/ext4/inode.c:5916 ext4_ext_truncate+0x3d/0x140 fs/ext4/extents.c:4400 ext4_truncate+0x3c1/0x7c0 fs/ext4/inode.c:4153 ext4_setattr+0xc89/0x10b0 fs/ext4/inode.c:5460 notify_change+0x3f5/0x8b0 fs/attr.c:483 do_truncate+0xd8/0x130 fs/open.c:66 vfs_truncate+0x1fc/0x240 fs/open.c:112 do_sys_truncate+0x101/0x130 fs/open.c:135 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x6f/0xd9 RIP: 0033:0x7f7b8ad8ebe9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7b8bb4b038 EFLAGS: 00000246 ORIG_RAX: 000000000000004c RAX: ffffffffffffffda RBX: 00007f7b8afb5fa0 RCX: 00007f7b8ad8ebe9 RDX: 0000000000000000 RSI: 000000000000041a RDI: 00002000000000c0 RBP: 00007f7b8ae11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f7b8afb6038 R14: 00007f7b8afb5fa0 R15: 00007ffebdc7da78