EXT4-fs (loop6): 1 truncate cleaned up EXT4-fs (loop6): mounted filesystem without journal. Opts: i_version,nombcache,debug_want_extra_isize=0x0000000000000068,lazytime,block_validity,sysvgroups,,errors=continue. Quota mode: none. ====================================================== WARNING: possible circular locking dependency detected 5.15.186-syzkaller #0 Not tainted ------------------------------------------------------ syz.6.428/6153 is trying to acquire lock: ffff888074bf8de8 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] ffff888074bf8de8 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: ext4_xattr_inode_create fs/ext4/xattr.c:1474 [inline] ffff888074bf8de8 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1556 [inline] ffff888074bf8de8 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: ext4_xattr_set_entry+0x34fb/0x3d30 fs/ext4/xattr.c:1684 but task is already holding lock: ffff888074bfc840 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_setattr+0x133d/0x19e0 fs/ext4/inode.c:5546 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ei->i_data_sem/3){++++}-{3:3}: down_write+0x38/0x60 kernel/locking/rwsem.c:1551 ext4_update_i_disksize fs/ext4/ext4.h:3409 [inline] ext4_xattr_inode_write fs/ext4/xattr.c:1412 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1560 [inline] ext4_xattr_set_entry+0x32c3/0x3d30 fs/ext4/xattr.c:1684 ext4_xattr_block_set+0x973/0x2d30 fs/ext4/xattr.c:2004 ext4_xattr_set_handle+0xbd5/0x12b0 fs/ext4/xattr.c:2421 ext4_xattr_set+0x22a/0x320 fs/ext4/xattr.c:2522 __vfs_setxattr+0x3e0/0x420 fs/xattr.c:182 __vfs_setxattr_noperm+0x129/0x5e0 fs/xattr.c:216 vfs_setxattr+0x168/0x2f0 fs/xattr.c:303 do_setxattr fs/xattr.c:588 [inline] setxattr+0x2da/0x300 fs/xattr.c:611 path_setxattr+0x142/0x280 fs/xattr.c:630 __do_sys_setxattr fs/xattr.c:646 [inline] __se_sys_setxattr fs/xattr.c:642 [inline] __x64_sys_setxattr+0xb7/0xd0 fs/xattr.c:642 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 down_write+0x38/0x60 kernel/locking/rwsem.c:1551 inode_lock include/linux/fs.h:787 [inline] ext4_xattr_inode_create fs/ext4/xattr.c:1474 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1556 [inline] ext4_xattr_set_entry+0x34fb/0x3d30 fs/ext4/xattr.c:1684 ext4_xattr_block_set+0x4f7/0x2d30 fs/ext4/xattr.c:1935 ext4_xattr_move_to_block fs/ext4/xattr.c:2632 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2707 [inline] ext4_expand_extra_isize_ea+0xf4b/0x19a0 fs/ext4/xattr.c:2799 __ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5887 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5930 [inline] __ext4_mark_inode_dirty+0x469/0x700 fs/ext4/inode.c:6008 ext4_setattr+0x13b7/0x19e0 fs/ext4/inode.c:5549 notify_change+0xbcd/0xee0 fs/attr.c:505 do_truncate+0x197/0x220 fs/open.c:65 handle_truncate fs/namei.c:3265 [inline] do_open fs/namei.c:3612 [inline] path_openat+0x28af/0x2f30 fs/namei.c:3742 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x142/0x4a0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem/3); lock(&sb->s_type->i_mutex_key#9/1); lock(&ei->i_data_sem/3); lock(&sb->s_type->i_mutex_key#9/1); *** DEADLOCK *** 5 locks held by syz.6.428/6153: #0: ffff888059eb2460 (sb_writers#5){++++}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:377 #1: ffff888074bfc9b8 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #1: ffff888074bfc9b8 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: do_truncate+0x183/0x220 fs/open.c:63 #2: ffff888074bfcb58 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:832 [inline] #2: ffff888074bfcb58 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_setattr+0xdb6/0x19e0 fs/ext4/inode.c:5506 #3: ffff888074bfc840 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_setattr+0x133d/0x19e0 fs/ext4/inode.c:5546 #4: ffff888074bfc690 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] #4: ffff888074bfc690 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:5927 [inline] #4: ffff888074bfc690 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x3e8/0x700 fs/ext4/inode.c:6008 stack backtrace: CPU: 0 PID: 6153 Comm: syz.6.428 Not tainted 5.15.186-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 down_write+0x38/0x60 kernel/locking/rwsem.c:1551 inode_lock include/linux/fs.h:787 [inline] ext4_xattr_inode_create fs/ext4/xattr.c:1474 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1556 [inline] ext4_xattr_set_entry+0x34fb/0x3d30 fs/ext4/xattr.c:1684 ext4_xattr_block_set+0x4f7/0x2d30 fs/ext4/xattr.c:1935 ext4_xattr_move_to_block fs/ext4/xattr.c:2632 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2707 [inline] ext4_expand_extra_isize_ea+0xf4b/0x19a0 fs/ext4/xattr.c:2799 __ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5887 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5930 [inline] __ext4_mark_inode_dirty+0x469/0x700 fs/ext4/inode.c:6008 ext4_setattr+0x13b7/0x19e0 fs/ext4/inode.c:5549 notify_change+0xbcd/0xee0 fs/attr.c:505 do_truncate+0x197/0x220 fs/open.c:65 handle_truncate fs/namei.c:3265 [inline] do_open fs/namei.c:3612 [inline] path_openat+0x28af/0x2f30 fs/namei.c:3742 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x142/0x4a0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fa9fed58929 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:00007fa9fcbc0038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fa9fef7ffa0 RCX: 00007fa9fed58929 RDX: 0000000000000242 RSI: 0000200000000040 RDI: ffffffffffffff9c RBP: 00007fa9feddab39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fa9fef7ffa0 R15: 00007ffd34a234c8