loop6: detected capacity change from 0 to 512
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.6.2329/11760 is trying to acquire lock:
ffff888051dfeb98 (&sbi->s_writepages_rwsem){.+.+}-{0:0}, at: ext4_writepages+0x20f/0x2f40 fs/ext4/inode.c:2715
but task is already holding lock:
ffff888070196518 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:165 [inline]
ffff888070196518 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6024 [inline]
ffff888070196518 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x3fe/0x770 fs/ext4/inode.c:6105
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&ei->xattr_sem){++++}-{3:3}:
down_write+0x36/0x60 kernel/locking/rwsem.c:1573
ext4_write_lock_xattr fs/ext4/xattr.h:158 [inline]
ext4_destroy_inline_data+0x24/0xe0 fs/ext4/inline.c:1922
ext4_writepages+0x670/0x2f40 fs/ext4/inode.c:2761
do_writepages+0x3ba/0x640 mm/page-writeback.c:2491
filemap_fdatawrite_wbc+0x11e/0x180 mm/filemap.c:388
__filemap_fdatawrite_range mm/filemap.c:421 [inline]
__filemap_fdatawrite mm/filemap.c:427 [inline]
filemap_flush+0xe0/0x140 mm/filemap.c:454
ext4_release_file+0x7e/0x300 fs/ext4/file.c:158
__fput+0x22c/0x920 fs/file_table.c:320
task_work_run+0x1d0/0x260 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
__syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x68/0xd2
-> #0 (&sbi->s_writepages_rwsem){.+.+}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2d07/0x7d10 kernel/locking/lockdep.c:5049
lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5662
percpu_down_read+0x44/0x1a0 include/linux/percpu-rwsem.h:51
ext4_writepages+0x20f/0x2f40 fs/ext4/inode.c:2715
do_writepages+0x3ba/0x640 mm/page-writeback.c:2491
__writeback_single_inode+0x156/0x1160 fs/fs-writeback.c:1622
writeback_single_inode+0x3cb/0x8e0 fs/fs-writeback.c:1743
write_inode_now+0x17f/0x210 fs/fs-writeback.c:2780
iput_final fs/inode.c:1821 [inline]
iput+0x613/0x980 fs/inode.c:1860
ext4_xattr_block_set+0x273b/0x32b0 fs/ext4/xattr.c:2145
ext4_xattr_move_to_block fs/ext4/xattr.c:2610 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2685 [inline]
ext4_expand_extra_isize_ea+0x120b/0x1dc0 fs/ext4/xattr.c:2773
__ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5984
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6027 [inline]
__ext4_mark_inode_dirty+0x47f/0x770 fs/ext4/inode.c:6105
ext4_evict_inode+0xa7f/0x1110 fs/ext4/inode.c:279
evict+0x4c9/0x8d0 fs/inode.c:705
ext4_orphan_cleanup+0xbeb/0x1420 fs/ext4/orphan.c:472
__ext4_fill_super fs/ext4/super.c:5556 [inline]
ext4_fill_super+0x7829/0x7dc0 fs/ext4/super.c:5687
get_tree_bdev+0x3f1/0x610 fs/super.c:1366
vfs_get_tree+0x88/0x270 fs/super.c:1573
do_new_mount+0x24a/0xa40 fs/namespace.c:3078
do_mount fs/namespace.c:3421 [inline]
__do_sys_mount fs/namespace.c:3629 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3606
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&ei->xattr_sem);
lock(&sbi->s_writepages_rwsem);
lock(&ei->xattr_sem);
lock(&sbi->s_writepages_rwsem);
*** DEADLOCK ***
3 locks held by syz.6.2329/11760:
#0: ffff8880797680e0 (&type->s_umount_key#27/1){+.+.}-{3:3}, at: alloc_super+0x1fa/0x930 fs/super.c:228
#1: ffff888079768650 (sb_internal){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1891 [inline]
#1: ffff888079768650 (sb_internal){.+.+}-{0:0}, at: sb_start_intwrite include/linux/fs.h:2013 [inline]
#1: ffff888079768650 (sb_internal){.+.+}-{0:0}, at: ext4_evict_inode+0x43c/0x1110 fs/ext4/inode.c:240
#2: ffff888070196518 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:165 [inline]
#2: ffff888070196518 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6024 [inline]
#2: ffff888070196518 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x3fe/0x770 fs/ext4/inode.c:6105
stack backtrace:
CPU: 1 PID: 11760 Comm: syz.6.2329 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2170
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2d07/0x7d10 kernel/locking/lockdep.c:5049
lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5662
percpu_down_read+0x44/0x1a0 include/linux/percpu-rwsem.h:51
ext4_writepages+0x20f/0x2f40 fs/ext4/inode.c:2715
do_writepages+0x3ba/0x640 mm/page-writeback.c:2491
__writeback_single_inode+0x156/0x1160 fs/fs-writeback.c:1622
writeback_single_inode+0x3cb/0x8e0 fs/fs-writeback.c:1743
write_inode_now+0x17f/0x210 fs/fs-writeback.c:2780
iput_final fs/inode.c:1821 [inline]
iput+0x613/0x980 fs/inode.c:1860
ext4_xattr_block_set+0x273b/0x32b0 fs/ext4/xattr.c:2145
ext4_xattr_move_to_block fs/ext4/xattr.c:2610 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2685 [inline]
ext4_expand_extra_isize_ea+0x120b/0x1dc0 fs/ext4/xattr.c:2773
__ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5984
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6027 [inline]
__ext4_mark_inode_dirty+0x47f/0x770 fs/ext4/inode.c:6105
ext4_evict_inode+0xa7f/0x1110 fs/ext4/inode.c:279
evict+0x4c9/0x8d0 fs/inode.c:705
ext4_orphan_cleanup+0xbeb/0x1420 fs/ext4/orphan.c:472
__ext4_fill_super fs/ext4/super.c:5556 [inline]
ext4_fill_super+0x7829/0x7dc0 fs/ext4/super.c:5687
get_tree_bdev+0x3f1/0x610 fs/super.c:1366
vfs_get_tree+0x88/0x270 fs/super.c:1573
do_new_mount+0x24a/0xa40 fs/namespace.c:3078
do_mount fs/namespace.c:3421 [inline]
__do_sys_mount fs/namespace.c:3629 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3606
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fbc1839bf4a
Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbc1933de58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fbc1933dee0 RCX: 00007fbc1839bf4a
RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007fbc1933dea0
RBP: 0000200000000180 R08: 00007fbc1933dee0 R09: 0000000000800700
R10: 0000000000800700 R11: 0000000000000246 R12: 00002000000001c0
R13: 00007fbc1933dea0 R14: 000000000000046f R15: 0000200000000400
------------[ cut here ]------------
EA inode 11 i_nlink=2
WARNING: CPU: 1 PID: 11760 at fs/ext4/xattr.c:1005 ext4_xattr_inode_update_ref+0x4bd/0x510 fs/ext4/xattr.c:1003
Modules linked in:
CPU: 1 PID: 11760 Comm: syz.6.2329 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
RIP: 0010:ext4_xattr_inode_update_ref+0x4bd/0x510 fs/ext4/xattr.c:1003
Code: 7c 24 40 4c 89 f8 48 c1 e8 03 42 80 3c 30 00 74 08 4c 89 ff e8 a4 ce 9b ff 49 8b 37 48 c7 c7 c0 94 a0 8a 89 da e8 f3 55 16 ff <0f> 0b 4c 8b 64 24 08 4c 8b 7c 24 10 e9 a9 fe ff ff e8 8d 34 f3 07
RSP: 0018:ffffc90005d9f1e0 EFLAGS: 00010246
RAX: 6c714a782a041d00 RBX: 0000000000000002 RCX: 0000000000080000
RDX: ffffc9000cdd9000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90005d9f2d8 R08: ffff8880b8f279db R09: 1ffff110171e4f3b
R10: dffffc0000000000 R11: ffffed10171e4f3c R12: ffff8880701952f0
R13: 1ffff1100e032a9d R14: dffffc0000000000 R15: ffff888070195330
FS: 00007fbc1933e6c0(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000558cbd7d2950 CR3: 000000007e413000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
ext4_xattr_inode_dec_ref fs/ext4/xattr.c:1028 [inline]
ext4_xattr_set_entry+0xb33/0x1e90 fs/ext4/xattr.c:1670
ext4_xattr_ibody_set+0x250/0x690 fs/ext4/xattr.c:2214
ext4_xattr_move_to_block fs/ext4/xattr.c:2617 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2685 [inline]
ext4_expand_extra_isize_ea+0x12c7/0x1dc0 fs/ext4/xattr.c:2773
__ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5984
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6027 [inline]
__ext4_mark_inode_dirty+0x47f/0x770 fs/ext4/inode.c:6105
ext4_evict_inode+0xa7f/0x1110 fs/ext4/inode.c:279
evict+0x4c9/0x8d0 fs/inode.c:705
ext4_orphan_cleanup+0xbeb/0x1420 fs/ext4/orphan.c:472
__ext4_fill_super fs/ext4/super.c:5556 [inline]
ext4_fill_super+0x7829/0x7dc0 fs/ext4/super.c:5687
get_tree_bdev+0x3f1/0x610 fs/super.c:1366
vfs_get_tree+0x88/0x270 fs/super.c:1573
do_new_mount+0x24a/0xa40 fs/namespace.c:3078
do_mount fs/namespace.c:3421 [inline]
__do_sys_mount fs/namespace.c:3629 [inline]
__se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3606
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fbc1839bf4a
Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbc1933de58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fbc1933dee0 RCX: 00007fbc1839bf4a
RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007fbc1933dea0
RBP: 0000200000000180 R08: 00007fbc1933dee0 R09: 0000000000800700
R10: 0000000000800700 R11: 0000000000000246 R12: 00002000000001c0
R13: 00007fbc1933dea0 R14: 000000000000046f R15: 0000200000000400