loop6: detected capacity change from 0 to 512
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.6.2372/16551 is trying to acquire lock:
ffff88804e860b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: percpu_down_read include/linux/percpu-rwsem.h:77 [inline]
ffff88804e860b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1786 [inline]
ffff88804e860b98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x1cc/0x350 fs/ext4/inode.c:3024
but task is already holding lock:
ffff888034a0b098 (&ei->xattr_sem){++++}-{4:4}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:164 [inline]
ffff888034a0b098 (&ei->xattr_sem){++++}-{4:4}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6425 [inline]
ffff888034a0b098 (&ei->xattr_sem){++++}-{4:4}, at: __ext4_mark_inode_dirty+0x3eb/0x700 fs/ext4/inode.c:6506
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&ei->xattr_sem){++++}-{4:4}:
lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868
down_write+0x96/0x1f0 kernel/locking/rwsem.c:1590
ext4_write_lock_xattr fs/ext4/xattr.h:157 [inline]
ext4_destroy_inline_data+0x28/0xe0 fs/ext4/inline.c:1787
ext4_do_writepages+0x526/0x4610 fs/ext4/inode.c:2810
ext4_writepages+0x205/0x350 fs/ext4/inode.c:3025
do_writepages+0x32e/0x550 mm/page-writeback.c:2634
filemap_fdatawrite_wbc mm/filemap.c:386 [inline]
__filemap_fdatawrite_range mm/filemap.c:419 [inline]
file_write_and_wait_range+0x23e/0x340 mm/filemap.c:794
generic_buffers_fsync_noflush+0x6c/0x180 fs/buffer.c:609
ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
ext4_sync_file+0x332/0xb20 fs/ext4/fsync.c:147
generic_write_sync include/linux/fs.h:3043 [inline]
ext4_buffered_write_iter+0x2ca/0x3a0 fs/ext4/file.c:305
ext4_file_write_iter+0x298/0x1bc0 fs/ext4/file.c:-1
iter_file_splice_write+0x975/0x10e0 fs/splice.c:738
do_splice_from fs/splice.c:938 [inline]
direct_splice_actor+0x101/0x160 fs/splice.c:1161
splice_direct_to_actor+0x5a8/0xcc0 fs/splice.c:1105
do_splice_direct_actor fs/splice.c:1204 [inline]
do_splice_direct+0x181/0x270 fs/splice.c:1230
do_sendfile+0x4da/0x7e0 fs/read_write.c:1370
__do_sys_sendfile64 fs/read_write.c:1431 [inline]
__se_sys_sendfile64+0x13e/0x190 fs/read_write.c:1417
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #0 (&sbi->s_writepages_rwsem){++++}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3165 [inline]
check_prevs_add kernel/locking/lockdep.c:3284 [inline]
validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3908
__lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237
lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868
percpu_down_read_internal+0x48/0x1c0 include/linux/percpu-rwsem.h:53
percpu_down_read include/linux/percpu-rwsem.h:77 [inline]
ext4_writepages_down_read fs/ext4/ext4.h:1786 [inline]
ext4_writepages+0x1cc/0x350 fs/ext4/inode.c:3024
do_writepages+0x32e/0x550 mm/page-writeback.c:2634
__writeback_single_inode+0x145/0xff0 fs/fs-writeback.c:1680
writeback_single_inode+0x1f3/0x6a0 fs/fs-writeback.c:1801
write_inode_now+0x160/0x1d0 fs/fs-writeback.c:2864
iput_final fs/inode.c:1884 [inline]
iput+0x5b9/0x9d0 fs/inode.c:1923
ext4_xattr_block_set+0x1fce/0x2ac0 fs/ext4/xattr.c:2194
ext4_xattr_move_to_block fs/ext4/xattr.c:2659 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2734 [inline]
ext4_expand_extra_isize_ea+0x12d5/0x1ea0 fs/ext4/xattr.c:2822
__ext4_expand_extra_isize+0x30d/0x400 fs/ext4/inode.c:6385
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6428 [inline]
__ext4_mark_inode_dirty+0x46c/0x700 fs/ext4/inode.c:6506
ext4_evict_inode+0x80d/0xee0 fs/ext4/inode.c:254
evict+0x504/0x9c0 fs/inode.c:810
ext4_orphan_cleanup+0xc20/0x1460 fs/ext4/orphan.c:474
__ext4_fill_super fs/ext4/super.c:5609 [inline]
ext4_fill_super+0x57df/0x6090 fs/ext4/super.c:5728
get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1692
vfs_get_tree+0x92/0x2b0 fs/super.c:1815
do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
do_mount fs/namespace.c:4136 [inline]
__do_sys_mount fs/namespace.c:4347 [inline]
__se_sys_mount+0x317/0x410 fs/namespace.c:4324
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
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);
rlock(&sbi->s_writepages_rwsem);
*** DEADLOCK ***
3 locks held by syz.6.2372/16551:
#0: ffff88802961e0e0 (&type->s_umount_key#28/1){+.+.}-{4:4}, at: alloc_super+0x204/0x970 fs/super.c:345
#1: ffff88802961e618 (sb_internal){.+.+}-{0:0}, at: percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline]
#1: ffff88802961e618 (sb_internal){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1799 [inline]
#1: ffff88802961e618 (sb_internal){.+.+}-{0:0}, at: sb_start_intwrite include/linux/fs.h:1982 [inline]
#1: ffff88802961e618 (sb_internal){.+.+}-{0:0}, at: ext4_evict_inode+0x2d6/0xee0 fs/ext4/inode.c:215
#2: ffff888034a0b098 (&ei->xattr_sem){++++}-{4:4}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:164 [inline]
#2: ffff888034a0b098 (&ei->xattr_sem){++++}-{4:4}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6425 [inline]
#2: ffff888034a0b098 (&ei->xattr_sem){++++}-{4:4}, at: __ext4_mark_inode_dirty+0x3eb/0x700 fs/ext4/inode.c:6506
stack backtrace:
CPU: 1 UID: 0 PID: 16551 Comm: syz.6.2372 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_circular_bug+0x2ee/0x310 kernel/locking/lockdep.c:2043
check_noncircular+0x134/0x160 kernel/locking/lockdep.c:2175
check_prev_add kernel/locking/lockdep.c:3165 [inline]
check_prevs_add kernel/locking/lockdep.c:3284 [inline]
validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3908
__lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237
lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868
percpu_down_read_internal+0x48/0x1c0 include/linux/percpu-rwsem.h:53
percpu_down_read include/linux/percpu-rwsem.h:77 [inline]
ext4_writepages_down_read fs/ext4/ext4.h:1786 [inline]
ext4_writepages+0x1cc/0x350 fs/ext4/inode.c:3024
do_writepages+0x32e/0x550 mm/page-writeback.c:2634
__writeback_single_inode+0x145/0xff0 fs/fs-writeback.c:1680
writeback_single_inode+0x1f3/0x6a0 fs/fs-writeback.c:1801
write_inode_now+0x160/0x1d0 fs/fs-writeback.c:2864
iput_final fs/inode.c:1884 [inline]
iput+0x5b9/0x9d0 fs/inode.c:1923
ext4_xattr_block_set+0x1fce/0x2ac0 fs/ext4/xattr.c:2194
ext4_xattr_move_to_block fs/ext4/xattr.c:2659 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2734 [inline]
ext4_expand_extra_isize_ea+0x12d5/0x1ea0 fs/ext4/xattr.c:2822
__ext4_expand_extra_isize+0x30d/0x400 fs/ext4/inode.c:6385
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6428 [inline]
__ext4_mark_inode_dirty+0x46c/0x700 fs/ext4/inode.c:6506
ext4_evict_inode+0x80d/0xee0 fs/ext4/inode.c:254
evict+0x504/0x9c0 fs/inode.c:810
ext4_orphan_cleanup+0xc20/0x1460 fs/ext4/orphan.c:474
__ext4_fill_super fs/ext4/super.c:5609 [inline]
ext4_fill_super+0x57df/0x6090 fs/ext4/super.c:5728
get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1692
vfs_get_tree+0x92/0x2b0 fs/super.c:1815
do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
do_mount fs/namespace.c:4136 [inline]
__do_sys_mount fs/namespace.c:4347 [inline]
__se_sys_mount+0x317/0x410 fs/namespace.c:4324
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f0e2819034a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0e290a8e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f0e290a8ef0 RCX: 00007f0e2819034a
RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007f0e290a8eb0
RBP: 0000200000000180 R08: 00007f0e290a8ef0 R09: 0000000000800700
R10: 0000000000800700 R11: 0000000000000246 R12: 00002000000001c0
R13: 00007f0e290a8eb0 R14: 000000000000046f R15: 0000200000000680
------------[ cut here ]------------
EA inode 11 i_nlink=2
WARNING: CPU: 0 PID: 16551 at fs/ext4/xattr.c:1053 ext4_xattr_inode_update_ref+0x534/0x5d0 fs/ext4/xattr.c:1051
Modules linked in:
CPU: 0 UID: 0 PID: 16551 Comm: syz.6.2372 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:ext4_xattr_inode_update_ref+0x534/0x5d0 fs/ext4/xattr.c:1051
Code: 00 00 00 00 00 fc ff df 41 0f b6 44 05 00 84 c0 0f 85 86 00 00 00 41 8b 14 24 48 c7 c7 60 e6 9f 8b 4c 89 fe e8 0d 4c fd fe 90 <0f> 0b 90 90 48 bb 00 00 00 00 00 fc ff df e9 bb fd ff ff e8 84 48
RSP: 0018:ffffc900038df1a0 EFLAGS: 00010246
RAX: 2bf634c86bfe5800 RBX: dffffc0000000000 RCX: 0000000000080000
RDX: ffffc90014d0b000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc900038df298 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffffbfff1bfa22c R12: ffff8880792c9600
R13: 1ffff1100f2592c0 R14: 00000000ffffffff R15: 000000000000000b
FS: 00007f0e290a96c0(0000) GS:ffff888125c13000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f94d16daa10 CR3: 000000004b3d2000 CR4: 0000000000350ef0
Call Trace:
ext4_xattr_inode_dec_ref fs/ext4/xattr.c:1076 [inline]
ext4_xattr_set_entry+0xabb/0x1e20 fs/ext4/xattr.c:1714
ext4_xattr_ibody_set+0x254/0x6a0 fs/ext4/xattr.c:2263
ext4_xattr_move_to_block fs/ext4/xattr.c:2666 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2734 [inline]
ext4_expand_extra_isize_ea+0x13a8/0x1ea0 fs/ext4/xattr.c:2822
__ext4_expand_extra_isize+0x30d/0x400 fs/ext4/inode.c:6385
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6428 [inline]
__ext4_mark_inode_dirty+0x46c/0x700 fs/ext4/inode.c:6506
ext4_evict_inode+0x80d/0xee0 fs/ext4/inode.c:254
evict+0x504/0x9c0 fs/inode.c:810
ext4_orphan_cleanup+0xc20/0x1460 fs/ext4/orphan.c:474
__ext4_fill_super fs/ext4/super.c:5609 [inline]
ext4_fill_super+0x57df/0x6090 fs/ext4/super.c:5728
get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1692
vfs_get_tree+0x92/0x2b0 fs/super.c:1815
do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
do_mount fs/namespace.c:4136 [inline]
__do_sys_mount fs/namespace.c:4347 [inline]
__se_sys_mount+0x317/0x410 fs/namespace.c:4324
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f0e2819034a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0e290a8e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f0e290a8ef0 RCX: 00007f0e2819034a
RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007f0e290a8eb0
RBP: 0000200000000180 R08: 00007f0e290a8ef0 R09: 0000000000800700
R10: 0000000000800700 R11: 0000000000000246 R12: 00002000000001c0
R13: 00007f0e290a8eb0 R14: 000000000000046f R15: 0000200000000680