loop2: detected capacity change from 0 to 512 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.1245/12253 is trying to acquire lock: ffff88801c786bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline] ffff88801c786bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x170/0x2f0 fs/ext4/inode.c:2806 but task is already holding lock: ffff888059c4c6c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] ffff888059c4c6c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6007 [inline] ffff888059c4c6c8 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x3dc/0x6e0 fs/ext4/inode.c:6088 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ei->xattr_sem){++++}-{3:3}: down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573 ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline] ext4_destroy_inline_data+0x28/0xe0 fs/ext4/inline.c:1884 ext4_do_writepages+0x4c2/0x38d0 fs/ext4/inode.c:2604 ext4_writepages+0x1a8/0x2f0 fs/ext4/inode.c:2807 do_writepages+0x3a2/0x600 mm/page-writeback.c:2575 filemap_fdatawrite_wbc+0x122/0x180 mm/filemap.c:390 __filemap_fdatawrite_range mm/filemap.c:423 [inline] __filemap_fdatawrite mm/filemap.c:429 [inline] filemap_flush+0xc5/0x120 mm/filemap.c:456 ext4_release_file+0x82/0x310 fs/ext4/file.c:169 __fput+0x234/0x970 fs/file_table.c:384 task_work_run+0x1ce/0x250 kernel/task_work.c:239 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+0xf6/0x180 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&sbi->s_writepages_rwsem){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754 percpu_down_read+0x44/0x1a0 include/linux/percpu-rwsem.h:51 ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline] ext4_writepages+0x170/0x2f0 fs/ext4/inode.c:2806 do_writepages+0x3a2/0x600 mm/page-writeback.c:2575 __writeback_single_inode+0x153/0xee0 fs/fs-writeback.c:1635 writeback_single_inode+0x211/0x720 fs/fs-writeback.c:1756 write_inode_now+0x161/0x1e0 fs/fs-writeback.c:2802 iput_final fs/inode.c:1807 [inline] iput+0x5b2/0x920 fs/inode.c:1846 ext4_xattr_block_set+0x273a/0x32a0 fs/ext4/xattr.c:2211 ext4_xattr_move_to_block fs/ext4/xattr.c:2679 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2754 [inline] ext4_expand_extra_isize_ea+0x10ea/0x19e0 fs/ext4/xattr.c:2846 __ext4_expand_extra_isize+0x306/0x400 fs/ext4/inode.c:5967 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6010 [inline] __ext4_mark_inode_dirty+0x45d/0x6e0 fs/ext4/inode.c:6088 ext4_evict_inode+0x7ed/0xea0 fs/ext4/inode.c:252 evict+0x486/0x870 fs/inode.c:705 ext4_orphan_cleanup+0xbd4/0x1400 fs/ext4/orphan.c:470 __ext4_fill_super fs/ext4/super.c:5601 [inline] ext4_fill_super+0x5de4/0x66c0 fs/ext4/super.c:5724 get_tree_bdev+0x3e4/0x510 fs/super.c:1591 vfs_get_tree+0x8c/0x280 fs/super.c:1764 do_new_mount+0x24b/0xa40 fs/namespace.c:3386 do_mount fs/namespace.c:3726 [inline] __do_sys_mount fs/namespace.c:3935 [inline] __se_sys_mount+0x2da/0x3c0 fs/namespace.c:3912 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 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); rlock(&sbi->s_writepages_rwsem); *** DEADLOCK *** 3 locks held by syz.2.1245/12253: #0: ffff88802c4780e0 (&type->s_umount_key#31){++++}-{3:3}, at: __super_lock fs/super.c:56 [inline] #0: ffff88802c4780e0 (&type->s_umount_key#31){++++}-{3:3}, at: __super_lock_excl fs/super.c:71 [inline] #0: ffff88802c4780e0 (&type->s_umount_key#31){++++}-{3:3}, at: get_tree_bdev+0x344/0x510 fs/super.c:1589 #1: ffff88802c478608 (sb_internal){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1633 [inline] #1: ffff88802c478608 (sb_internal){.+.+}-{0:0}, at: sb_start_intwrite include/linux/fs.h:1755 [inline] #1: ffff88802c478608 (sb_internal){.+.+}-{0:0}, at: ext4_evict_inode+0x2b9/0xea0 fs/ext4/inode.c:213 #2: ffff888059c4c6c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] #2: ffff888059c4c6c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6007 [inline] #2: ffff888059c4c6c8 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x3dc/0x6e0 fs/ext4/inode.c:6088 stack backtrace: CPU: 0 PID: 12253 Comm: syz.2.1245 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106 check_noncircular+0x2bd/0x3c0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754 percpu_down_read+0x44/0x1a0 include/linux/percpu-rwsem.h:51 ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline] ext4_writepages+0x170/0x2f0 fs/ext4/inode.c:2806 do_writepages+0x3a2/0x600 mm/page-writeback.c:2575 __writeback_single_inode+0x153/0xee0 fs/fs-writeback.c:1635 writeback_single_inode+0x211/0x720 fs/fs-writeback.c:1756 write_inode_now+0x161/0x1e0 fs/fs-writeback.c:2802 iput_final fs/inode.c:1807 [inline] iput+0x5b2/0x920 fs/inode.c:1846 ext4_xattr_block_set+0x273a/0x32a0 fs/ext4/xattr.c:2211 ext4_xattr_move_to_block fs/ext4/xattr.c:2679 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2754 [inline] ext4_expand_extra_isize_ea+0x10ea/0x19e0 fs/ext4/xattr.c:2846 __ext4_expand_extra_isize+0x306/0x400 fs/ext4/inode.c:5967 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6010 [inline] __ext4_mark_inode_dirty+0x45d/0x6e0 fs/ext4/inode.c:6088 ext4_evict_inode+0x7ed/0xea0 fs/ext4/inode.c:252 evict+0x486/0x870 fs/inode.c:705 ext4_orphan_cleanup+0xbd4/0x1400 fs/ext4/orphan.c:470 __ext4_fill_super fs/ext4/super.c:5601 [inline] ext4_fill_super+0x5de4/0x66c0 fs/ext4/super.c:5724 get_tree_bdev+0x3e4/0x510 fs/super.c:1591 vfs_get_tree+0x8c/0x280 fs/super.c:1764 do_new_mount+0x24b/0xa40 fs/namespace.c:3386 do_mount fs/namespace.c:3726 [inline] __do_sys_mount fs/namespace.c:3935 [inline] __se_sys_mount+0x2da/0x3c0 fs/namespace.c:3912 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f4e74d90eea 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:00007f4e75b50e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f4e75b50ef0 RCX: 00007f4e74d90eea RDX: 0000200000000180 RSI: 00002000000001c0 RDI: 00007f4e75b50eb0 RBP: 0000200000000180 R08: 00007f4e75b50ef0 R09: 0000000000800700 R10: 0000000000800700 R11: 0000000000000246 R12: 00002000000001c0 R13: 00007f4e75b50eb0 R14: 000000000000046f R15: 000000000000002c EXT4-fs error (device loop2): ext4_xattr_inode_iget:444: inode #11: comm syz.2.1245: iget: bad extra_isize 90 (inode size 256) EXT4-fs (loop2): Remounting filesystem read-only EXT4-fs warning (device loop2): ext4_evict_inode:255: couldn't mark inode dirty (err -5) EXT4-fs (loop2): 1 orphan inode deleted EXT4-fs (loop2): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.