====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ kworker/u8:1/14 is trying to acquire lock: ffff0000dca9d520 (&ei->xattr_sem){++++}-{4:4}, at: ext4_write_lock_xattr fs/ext4/xattr.h:157 [inline] ffff0000dca9d520 (&ei->xattr_sem){++++}-{4:4}, at: ext4_destroy_inline_data+0x30/0x114 fs/ext4/inline.c:1805 but task is already holding lock: ffff0000f8c22c18 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: percpu_down_read include/linux/percpu-rwsem.h:77 [inline] ffff0000f8c22c18 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1811 [inline] ffff0000f8c22c18 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x16c/0x2d8 fs/ext4/inode.c:3041 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sbi->s_writepages_rwsem){++++}-{0:0}: percpu_down_read_internal+0x5c/0x294 include/linux/percpu-rwsem.h:53 percpu_down_read include/linux/percpu-rwsem.h:77 [inline] ext4_writepages_down_read fs/ext4/ext4.h:1811 [inline] ext4_writepages+0x16c/0x2d8 fs/ext4/inode.c:3041 do_writepages+0x270/0x468 mm/page-writeback.c:2575 __writeback_single_inode+0x144/0x1808 fs/fs-writeback.c:1764 writeback_single_inode+0x3b8/0xaa0 fs/fs-writeback.c:1883 write_inode_now+0x170/0x208 fs/fs-writeback.c:2974 iput_final fs/inode.c:1950 [inline] iput+0x6bc/0xb90 fs/inode.c:2009 ext4_xattr_block_set+0x1aac/0x2188 fs/ext4/xattr.c:2153 ext4_xattr_move_to_block fs/ext4/xattr.c:2671 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2746 [inline] ext4_expand_extra_isize_ea+0xb18/0x13a0 fs/ext4/xattr.c:2834 __ext4_expand_extra_isize+0x29c/0x370 fs/ext4/inode.c:6434 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6477 [inline] __ext4_mark_inode_dirty+0x3a4/0x810 fs/ext4/inode.c:6555 ext4_evict_inode+0x7a0/0xfc4 fs/ext4/inode.c:267 evict+0x4b8/0x740 fs/inode.c:841 iput_final fs/inode.c:1960 [inline] iput+0x858/0xb90 fs/inode.c:2009 ext4_process_orphan+0x240/0x2b4 fs/ext4/orphan.c:358 ext4_orphan_cleanup+0x7b8/0xd30 fs/ext4/orphan.c:472 __ext4_fill_super fs/ext4/super.c:5701 [inline] ext4_fill_super+0x45a4/0x4d60 fs/ext4/super.c:5824 get_tree_bdev_flags+0x380/0x434 fs/super.c:1694 get_tree_bdev+0x2c/0x3c fs/super.c:1717 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5856 vfs_get_tree+0x90/0x28c fs/super.c:1754 fc_mount+0x24/0xac fs/namespace.c:1193 do_new_mount_fc fs/namespace.c:3758 [inline] do_new_mount+0x2a4/0x540 fs/namespace.c:3834 path_mount+0x5d0/0xa68 fs/namespace.c:4154 do_mount+0xe8/0x148 fs/namespace.c:4167 __do_sys_mount fs/namespace.c:4383 [inline] __se_sys_mount fs/namespace.c:4360 [inline] __arm64_sys_mount+0x334/0x380 fs/namespace.c:4360 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49 el0_svc_common+0xe8/0x23c arch/arm64/kernel/syscall.c:121 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:140 el0_svc+0x60/0x25c arch/arm64/kernel/entry-common.c:723 el0t_64_sync_handler+0x48/0x148 arch/arm64/kernel/entry-common.c:742 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:594 -> #0 (&ei->xattr_sem){++++}-{4:4}: 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+0x1780/0x2f44 kernel/locking/lockdep.c:5237 lock_acquire+0x140/0x368 kernel/locking/lockdep.c:5868 down_write+0x50/0xc0 kernel/locking/rwsem.c:1625 ext4_write_lock_xattr fs/ext4/xattr.h:157 [inline] ext4_destroy_inline_data+0x30/0x114 fs/ext4/inline.c:1805 ext4_do_writepages+0x474/0x3ac8 fs/ext4/inode.c:2827 ext4_writepages+0x194/0x2d8 fs/ext4/inode.c:3042 do_writepages+0x270/0x468 mm/page-writeback.c:2575 __writeback_single_inode+0x144/0x1808 fs/fs-writeback.c:1764 writeback_sb_inodes+0x79c/0x1744 fs/fs-writeback.c:2056 wb_writeback+0x3d4/0x10e0 fs/fs-writeback.c:2241 wb_do_writeback fs/fs-writeback.c:2388 [inline] wb_workfn+0x328/0xcb4 fs/fs-writeback.c:2428 process_one_work+0x78c/0x173c kernel/workqueue.c:3302 process_scheduled_works+0xdc/0x13c kernel/workqueue.c:3385 worker_thread+0x770/0xbd0 kernel/workqueue.c:3466 kthread+0x2f0/0x3c0 kernel/kthread.c:436 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&sbi->s_writepages_rwsem); lock(&ei->xattr_sem); lock(&sbi->s_writepages_rwsem); lock(&ei->xattr_sem); *** DEADLOCK *** 3 locks held by kworker/u8:1/14: #0: ffff0000c1f21940 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x640/0x173c kernel/workqueue.c:3276 #1: ffff80008ea27be0 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x6a4/0x173c kernel/workqueue.c:3276 #2: ffff0000f8c22c18 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: percpu_down_read include/linux/percpu-rwsem.h:77 [inline] #2: ffff0000f8c22c18 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1811 [inline] #2: ffff0000f8c22c18 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x16c/0x2d8 fs/ext4/inode.c:3041 stack backtrace: CPU: 1 UID: 0 PID: 14 Comm: kworker/u8:1 Not tainted syzkaller #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026 Workqueue: writeback wb_workfn (flush-7:4) Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_circular_bug+0x328/0x330 kernel/locking/lockdep.c:2043 check_noncircular+0x158/0x174 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+0x1780/0x2f44 kernel/locking/lockdep.c:5237 lock_acquire+0x140/0x368 kernel/locking/lockdep.c:5868 down_write+0x50/0xc0 kernel/locking/rwsem.c:1625 ext4_write_lock_xattr fs/ext4/xattr.h:157 [inline] ext4_destroy_inline_data+0x30/0x114 fs/ext4/inline.c:1805 ext4_do_writepages+0x474/0x3ac8 fs/ext4/inode.c:2827 ext4_writepages+0x194/0x2d8 fs/ext4/inode.c:3042 do_writepages+0x270/0x468 mm/page-writeback.c:2575 __writeback_single_inode+0x144/0x1808 fs/fs-writeback.c:1764 writeback_sb_inodes+0x79c/0x1744 fs/fs-writeback.c:2056 wb_writeback+0x3d4/0x10e0 fs/fs-writeback.c:2241 wb_do_writeback fs/fs-writeback.c:2388 [inline] wb_workfn+0x328/0xcb4 fs/fs-writeback.c:2428 process_one_work+0x78c/0x173c kernel/workqueue.c:3302 process_scheduled_works+0xdc/0x13c kernel/workqueue.c:3385 worker_thread+0x770/0xbd0 kernel/workqueue.c:3466 kthread+0x2f0/0x3c0 kernel/kthread.c:436 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:842 EXT4-fs error (device loop4): ext4_mb_generate_buddy:1317: group 0, block bitmap and bg descriptor inconsistent: 25 vs 281 free clusters EXT4-fs (loop4): Delayed block allocation failed for inode 15 at logical offset 0 with max blocks 1 with error 28 EXT4-fs (loop4): This should not happen!! Data will be lost EXT4-fs (loop4): Total free blocks count 0 EXT4-fs (loop4): Free/Dirty block details EXT4-fs (loop4): free_blocks=4096 EXT4-fs (loop4): dirty_blocks=512 EXT4-fs (loop4): Block reservation details EXT4-fs (loop4): i_reserved_data_blocks=32 EXT4-fs (loop4): Delayed block allocation failed for inode 15 at logical offset 18 with max blocks 320 with error 28 EXT4-fs (loop4): This should not happen!! Data will be lost