EXT4-fs: Warning: mounting with an experimental mount option 'dioread_nolock' for blocksize < PAGE_SIZE EXT4-fs (loop0): 1 truncate cleaned up EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 without journal. Quota mode: writeback. ====================================================== WARNING: possible circular locking dependency detected 6.4.0-rc1-syzkaller-00132-g76c7f8873a76 #0 Not tainted ------------------------------------------------------ syz-executor.0/5435 is trying to acquire lock: ffff888075a9a200 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:775 [inline] ffff888075a9a200 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: ext4_xattr_inode_iget+0x4a3/0x5e0 fs/ext4/xattr.c:474 but task is already holding lock: ffff888075a99688 (&ei->i_data_sem){++++}-{3:3}, at: ext4_setattr+0x14d0/0x1bc0 fs/ext4/inode.c:5397 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ei->i_data_sem){++++}-{3:3}: lock_acquire+0x1df/0x520 kernel/locking/lockdep.c:5691 down_write+0x36/0x50 kernel/locking/rwsem.c:1573 ext4_update_i_disksize fs/ext4/ext4.h:3293 [inline] ext4_xattr_inode_write fs/ext4/xattr.c:1462 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1611 [inline] ext4_xattr_set_entry+0x3129/0x3be0 fs/ext4/xattr.c:1736 ext4_xattr_ibody_set+0x11d/0x330 fs/ext4/xattr.c:2288 ext4_xattr_set_handle+0xb96/0x15c0 fs/ext4/xattr.c:2445 ext4_xattr_set+0x23d/0x3d0 fs/ext4/xattr.c:2559 __vfs_setxattr+0x45c/0x4a0 fs/xattr.c:201 __vfs_setxattr_noperm+0x12a/0x5e0 fs/xattr.c:235 vfs_setxattr+0x21d/0x420 fs/xattr.c:322 do_setxattr fs/xattr.c:630 [inline] setxattr+0x259/0x2e0 fs/xattr.c:653 path_setxattr+0x1bc/0x2a0 fs/xattr.c:672 __do_sys_setxattr fs/xattr.c:688 [inline] __se_sys_setxattr fs/xattr.c:684 [inline] __x64_sys_setxattr+0xb7/0xd0 fs/xattr.c:684 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3842 __lock_acquire+0x1295/0x2000 kernel/locking/lockdep.c:5074 lock_acquire+0x1df/0x520 kernel/locking/lockdep.c:5691 down_write+0x36/0x50 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:775 [inline] ext4_xattr_inode_iget+0x4a3/0x5e0 fs/ext4/xattr.c:474 ext4_xattr_inode_get+0x160/0x430 fs/ext4/xattr.c:551 ext4_xattr_move_to_block fs/ext4/xattr.c:2640 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2742 [inline] ext4_expand_extra_isize_ea+0xf24/0x1d00 fs/ext4/xattr.c:2834 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5769 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5812 [inline] __ext4_mark_inode_dirty+0x53a/0x860 fs/ext4/inode.c:5890 ext4_setattr+0x1563/0x1bc0 fs/ext4/inode.c:5400 notify_change+0xc87/0xf30 fs/attr.c:483 do_truncate+0x21c/0x300 fs/open.c:66 handle_truncate fs/namei.c:3295 [inline] do_open fs/namei.c:3640 [inline] path_openat+0x294a/0x3170 fs/namei.c:3791 do_filp_open+0x230/0x480 fs/namei.c:3818 do_sys_openat2+0x13b/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_creat fs/open.c:1448 [inline] __se_sys_creat fs/open.c:1442 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1442 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem); lock(&ea_inode->i_rwsem#8/1); lock(&ei->i_data_sem); lock(&ea_inode->i_rwsem#8/1); *** DEADLOCK *** 5 locks held by syz-executor.0/5435: #0: ffff88807e1fe460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:394 #1: ffff888075a99800 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:775 [inline] #1: ffff888075a99800 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: do_truncate+0x208/0x300 fs/open.c:64 #2: ffff888075a999a0 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:820 [inline] #2: ffff888075a999a0 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_setattr+0xf2d/0x1bc0 fs/ext4/inode.c:5357 #3: ffff888075a99688 (&ei->i_data_sem){++++}-{3:3}, at: ext4_setattr+0x14d0/0x1bc0 fs/ext4/inode.c:5397 #4: ffff888075a994c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] #4: ffff888075a994c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:5809 [inline] #4: ffff888075a994c8 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x4a1/0x860 fs/ext4/inode.c:5890 stack backtrace: CPU: 0 PID: 5435 Comm: syz-executor.0 Not tainted 6.4.0-rc1-syzkaller-00132-g76c7f8873a76 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3842 __lock_acquire+0x1295/0x2000 kernel/locking/lockdep.c:5074 lock_acquire+0x1df/0x520 kernel/locking/lockdep.c:5691 down_write+0x36/0x50 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:775 [inline] ext4_xattr_inode_iget+0x4a3/0x5e0 fs/ext4/xattr.c:474 ext4_xattr_inode_get+0x160/0x430 fs/ext4/xattr.c:551 ext4_xattr_move_to_block fs/ext4/xattr.c:2640 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2742 [inline] ext4_expand_extra_isize_ea+0xf24/0x1d00 fs/ext4/xattr.c:2834 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5769 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5812 [inline] __ext4_mark_inode_dirty+0x53a/0x860 fs/ext4/inode.c:5890 ext4_setattr+0x1563/0x1bc0 fs/ext4/inode.c:5400 notify_change+0xc87/0xf30 fs/attr.c:483 do_truncate+0x21c/0x300 fs/open.c:66 handle_truncate fs/namei.c:3295 [inline] do_open fs/namei.c:3640 [inline] path_openat+0x294a/0x3170 fs/namei.c:3791 do_filp_open+0x230/0x480 fs/namei.c:3818 do_sys_openat2+0x13b/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_creat fs/open.c:1448 [inline] __se_sys_creat fs/open.c:1442 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1442 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f8f3308c169 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:00007f8f33ec7168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f8f331abf80 RCX: 00007f8f3308c169 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000080 RBP: 00007f8f330e7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd33b26e9f R14: 00007f8f33ec7300 R15: 0000000000022000