loop0: detected capacity change from 0 to 512 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.17/6409 is trying to acquire lock: ffff8880275aab98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: percpu_down_read include/linux/percpu-rwsem.h:77 [inline] ffff8880275aab98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1786 [inline] ffff8880275aab98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x1c8/0x350 fs/ext4/inode.c:3024 but task is already holding lock: ffff88805a1543b8 (&ei->xattr_sem){++++}-{4:4}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:164 [inline] ffff88805a1543b8 (&ei->xattr_sem){++++}-{4:4}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6425 [inline] ffff88805a1543b8 (&ei->xattr_sem){++++}-{4:4}, at: __ext4_mark_inode_dirty+0x3e7/0x6f0 fs/ext4/inode.c:6506 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ei->xattr_sem){++++}-{4:4}: down_read+0x42/0x2e0 kernel/locking/rwsem.c:1537 ext4_setattr+0x851/0x1bc0 fs/ext4/inode.c:5901 notify_change+0xb2f/0xe40 fs/attr.c:552 chown_common+0x408/0x5b0 fs/open.c:791 do_fchownat+0x15d/0x270 fs/open.c:822 __do_sys_chown fs/open.c:842 [inline] __se_sys_chown fs/open.c:840 [inline] __x64_sys_chown+0x7e/0x90 fs/open.c:840 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x86/0x2e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e -> #1 (jbd2_handle){++++}-{0:0}: start_this_handle+0x1f9d/0x21b0 fs/jbd2/transaction.c:444 jbd2__journal_start+0x2bd/0x5b0 fs/jbd2/transaction.c:501 __ext4_journal_start_sb+0x223/0x5a0 fs/ext4/ext4_jbd2.c:115 __ext4_journal_start fs/ext4/ext4_jbd2.h:242 [inline] ext4_do_writepages+0xf68/0x45e0 fs/ext4/inode.c:2913 ext4_writepages+0x201/0x350 fs/ext4/inode.c:3025 do_writepages+0x327/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+0x23a/0x340 mm/filemap.c:794 ext4_sync_file+0x2ad/0xb00 fs/ext4/fsync.c:154 vfs_fsync_range fs/sync.c:187 [inline] vfs_fsync fs/sync.c:201 [inline] do_fsync fs/sync.c:212 [inline] __do_sys_fsync fs/sync.c:217 [inline] __se_sys_fsync fs/sync.c:215 [inline] __x64_sys_fsync+0x187/0x1f0 fs/sync.c:215 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x86/0x2e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e -> #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 kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15bc/0x2df0 kernel/locking/lockdep.c:5237 lock_acquire+0x11c/0x350 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+0x1c8/0x350 fs/ext4/inode.c:3024 do_writepages+0x327/0x550 mm/page-writeback.c:2634 __writeback_single_inode+0x145/0xfc0 fs/fs-writeback.c:1680 writeback_single_inode+0x1f3/0x6a0 fs/fs-writeback.c:1801 write_inode_now+0x15c/0x1d0 fs/fs-writeback.c:2864 iput_final fs/inode.c:1884 [inline] iput+0x5a9/0x9c0 fs/inode.c:1923 ext4_xattr_block_set+0x1fca/0x2ab0 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+0x12d1/0x1e90 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+0x468/0x6f0 fs/ext4/inode.c:6506 ext4_evict_inode+0x809/0xed0 fs/ext4/inode.c:254 evict+0x4fd/0x9b0 fs/inode.c:810 ext4_orphan_cleanup+0xc1c/0x1450 fs/ext4/orphan.c:474 __ext4_fill_super fs/ext4/super.c:5609 [inline] ext4_fill_super+0x57db/0x6090 fs/ext4/super.c:5728 get_tree_bdev_flags+0x407/0x4d0 fs/super.c:1692 vfs_get_tree+0x8b/0x280 fs/super.c:1815 do_new_mount+0x29e/0x9e0 fs/namespace.c:3808 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount+0x313/0x410 fs/namespace.c:4324 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x86/0x2e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e other info that might help us debug this: Chain exists of: &sbi->s_writepages_rwsem --> jbd2_handle --> &ei->xattr_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->xattr_sem); lock(jbd2_handle); lock(&ei->xattr_sem); rlock(&sbi->s_writepages_rwsem); *** DEADLOCK *** 3 locks held by syz.0.17/6409: #0: ffff8880275a80e0 (&type->s_umount_key#28/1){+.+.}-{4:4}, at: alloc_super+0x204/0x970 fs/super.c:345 #1: ffff8880275a8618 (sb_internal){.+.+}-{0:0}, at: percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] #1: ffff8880275a8618 (sb_internal){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1799 [inline] #1: ffff8880275a8618 (sb_internal){.+.+}-{0:0}, at: sb_start_intwrite include/linux/fs.h:1982 [inline] #1: ffff8880275a8618 (sb_internal){.+.+}-{0:0}, at: ext4_evict_inode+0x2d2/0xed0 fs/ext4/inode.c:215 #2: ffff88805a1543b8 (&ei->xattr_sem){++++}-{4:4}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:164 [inline] #2: ffff88805a1543b8 (&ei->xattr_sem){++++}-{4:4}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6425 [inline] #2: ffff88805a1543b8 (&ei->xattr_sem){++++}-{4:4}, at: __ext4_mark_inode_dirty+0x3e7/0x6f0 fs/ext4/inode.c:6506 stack backtrace: CPU: 1 UID: 0 PID: 6409 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x185/0x250 lib/dump_stack.c:120 print_circular_bug+0x2ed/0x300 kernel/locking/lockdep.c:2043 check_noncircular+0x130/0x150 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 kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15bc/0x2df0 kernel/locking/lockdep.c:5237 lock_acquire+0x11c/0x350 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+0x1c8/0x350 fs/ext4/inode.c:3024 do_writepages+0x327/0x550 mm/page-writeback.c:2634 __writeback_single_inode+0x145/0xfc0 fs/fs-writeback.c:1680 writeback_single_inode+0x1f3/0x6a0 fs/fs-writeback.c:1801 write_inode_now+0x15c/0x1d0 fs/fs-writeback.c:2864 iput_final fs/inode.c:1884 [inline] iput+0x5a9/0x9c0 fs/inode.c:1923 ext4_xattr_block_set+0x1fca/0x2ab0 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+0x12d1/0x1e90 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+0x468/0x6f0 fs/ext4/inode.c:6506 ext4_evict_inode+0x809/0xed0 fs/ext4/inode.c:254 evict+0x4fd/0x9b0 fs/inode.c:810 ext4_orphan_cleanup+0xc1c/0x1450 fs/ext4/orphan.c:474 __ext4_fill_super fs/ext4/super.c:5609 [inline] ext4_fill_super+0x57db/0x6090 fs/ext4/super.c:5728 get_tree_bdev_flags+0x407/0x4d0 fs/super.c:1692 vfs_get_tree+0x8b/0x280 fs/super.c:1815 do_new_mount+0x29e/0x9e0 fs/namespace.c:3808 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount+0x313/0x410 fs/namespace.c:4324 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x86/0x2e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f0c3c19034a 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:00007f0c3cfcae68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f0c3cfcaef0 RCX: 00007f0c3c19034a RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007f0c3cfcaeb0 RBP: 0000200000000180 R08: 00007f0c3cfcaef0 R09: 0000000000800700 R10: 0000000000800700 R11: 0000000000000246 R12: 00002000000001c0 R13: 00007f0c3cfcaeb0 R14: 0000000000000473 R15: 0000200000000680 ------------[ cut here ]------------ EA inode 11 i_nlink=2 WARNING: CPU: 1 PID: 6409 at fs/ext4/xattr.c:1053 ext4_xattr_inode_update_ref+0x4e0/0x550 fs/ext4/xattr.c:1051 Modules linked in: CPU: 1 UID: 0 PID: 6409 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 RIP: 0010:ext4_xattr_inode_update_ref+0x4e0/0x550 fs/ext4/xattr.c:1051 Code: 65 40 4c 89 e0 48 c1 e8 03 80 3c 18 00 74 08 4c 89 e7 e8 03 3e 9e ff 49 8b 34 24 48 c7 c7 20 db 3f 8b 44 89 fa e8 70 34 ff fe <0f> 0b 48 bb 00 00 00 00 00 fc ff df 4c 8b 74 24 20 4c 8b 6c 24 18 RSP: 0018:ffffc90003aff1c0 EFLAGS: 00010246 RAX: a5ba2d7406990400 RBX: dffffc0000000000 RCX: ffff888026133c00 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000002 RBP: ffffc90003aff2b8 R08: 0000000000000003 R09: 0000000000000004 R10: dffffc0000000000 R11: fffffbfff1b3a0c8 R12: ffff88805a156278 R13: ffff88805a156238 R14: 1ffff9200075fe40 R15: 0000000000000002 FS: 00007f0c3cfcb6c0(0000) GS:ffff88812679e000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f0c3c171fe0 CR3: 000000007d9be000 CR4: 00000000003526f0 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+0x250/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+0x13a4/0x1e90 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+0x468/0x6f0 fs/ext4/inode.c:6506 ext4_evict_inode+0x809/0xed0 fs/ext4/inode.c:254 evict+0x4fd/0x9b0 fs/inode.c:810 ext4_orphan_cleanup+0xc1c/0x1450 fs/ext4/orphan.c:474 __ext4_fill_super fs/ext4/super.c:5609 [inline] ext4_fill_super+0x57db/0x6090 fs/ext4/super.c:5728 get_tree_bdev_flags+0x407/0x4d0 fs/super.c:1692 vfs_get_tree+0x8b/0x280 fs/super.c:1815 do_new_mount+0x29e/0x9e0 fs/namespace.c:3808 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount+0x313/0x410 fs/namespace.c:4324 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x86/0x2e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f0c3c19034a 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:00007f0c3cfcae68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f0c3cfcaef0 RCX: 00007f0c3c19034a RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007f0c3cfcaeb0 RBP: 0000200000000180 R08: 00007f0c3cfcaef0 R09: 0000000000800700 R10: 0000000000800700 R11: 0000000000000246 R12: 00002000000001c0 R13: 00007f0c3cfcaeb0 R14: 0000000000000473 R15: 0000200000000680