====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ kworker/u4:4/1582 is trying to acquire lock: ffff0000d83c6990 (jbd2_handle){++++}-{0:0}, at: wait_transaction_locked+0x15c/0x23c fs/jbd2/transaction.c:176 but task is already holding lock: ffff0000d83c2c18 (&sbi->s_writepages_rwsem){.+.+}-{0:0}, at: ext4_writepages+0x1b0/0x28fc fs/ext4/inode.c:2717 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sbi->s_writepages_rwsem){.+.+}-{0:0}: percpu_down_read+0x70/0x2a8 include/linux/percpu-rwsem.h:51 ext4_writepages+0x1b0/0x28fc fs/ext4/inode.c:2717 do_writepages+0x2c4/0x50c mm/page-writeback.c:2491 __writeback_single_inode+0x164/0x157c fs/fs-writeback.c:1673 writeback_single_inode+0x1cc/0x73c fs/fs-writeback.c:1794 write_inode_now+0x150/0x1cc fs/fs-writeback.c:2837 iput_final fs/inode.c:1821 [inline] iput+0x5b8/0x7e8 fs/inode.c:1860 ext4_xattr_block_set+0x1474/0x28b4 fs/ext4/xattr.c:2148 ext4_xattr_move_to_block fs/ext4/xattr.c:2613 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2688 [inline] ext4_expand_extra_isize_ea+0xea4/0x1818 fs/ext4/xattr.c:2776 __ext4_expand_extra_isize+0x2a0/0x364 fs/ext4/inode.c:6003 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6046 [inline] __ext4_mark_inode_dirty+0x3d4/0x7b4 fs/ext4/inode.c:6124 ext4_evict_inode+0xb50/0x1264 fs/ext4/inode.c:281 evict+0x3d8/0x824 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x728/0x7e8 fs/inode.c:1860 ext4_process_orphan+0x24c/0x2c0 fs/ext4/orphan.c:358 ext4_orphan_cleanup+0x964/0x1090 fs/ext4/orphan.c:472 __ext4_fill_super fs/ext4/super.c:5574 [inline] ext4_fill_super+0x5af8/0x63bc fs/ext4/super.c:5693 get_tree_bdev+0x35c/0x54c fs/super.c:1366 ext4_get_tree+0x28/0x38 fs/ext4/super.c:5723 vfs_get_tree+0x90/0x278 fs/super.c:1573 do_new_mount+0x228/0x804 fs/namespace.c:3078 path_mount+0x5ac/0xe6c fs/namespace.c:3408 do_mount fs/namespace.c:3421 [inline] __do_sys_mount fs/namespace.c:3629 [inline] __se_sys_mount fs/namespace.c:3606 [inline] __arm64_sys_mount+0x4a0/0x5a0 fs/namespace.c:3606 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #1 (&ei->xattr_sem){++++}-{3:3}: down_read+0x64/0x300 kernel/locking/rwsem.c:1520 ext4_setattr+0x79c/0x15e4 fs/ext4/inode.c:5526 notify_change+0xb5c/0xe20 fs/attr.c:499 chown_common+0x430/0x59c fs/open.c:736 do_fchownat+0x13c/0x248 fs/open.c:767 __do_sys_fchownat fs/open.c:782 [inline] __se_sys_fchownat fs/open.c:779 [inline] __arm64_sys_fchownat+0xc0/0xdc fs/open.c:779 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #0 (jbd2_handle){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063 lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5676 wait_transaction_locked+0x184/0x23c fs/jbd2/transaction.c:177 add_transaction_credits+0x104/0xaf0 fs/jbd2/transaction.c:-1 start_this_handle+0x4dc/0x125c fs/jbd2/transaction.c:422 jbd2__journal_start+0x288/0x530 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x2f8/0x66c fs/ext4/ext4_jbd2.c:105 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_writepages+0xa50/0x28fc fs/ext4/inode.c:2840 do_writepages+0x2c4/0x50c mm/page-writeback.c:2491 __writeback_single_inode+0x164/0x157c fs/fs-writeback.c:1673 writeback_sb_inodes+0x870/0x1470 fs/fs-writeback.c:1964 __writeback_inodes_wb+0x104/0x370 fs/fs-writeback.c:2035 wb_writeback+0x420/0xfdc fs/fs-writeback.c:2140 wb_check_old_data_flush fs/fs-writeback.c:2240 [inline] wb_do_writeback fs/fs-writeback.c:2293 [inline] wb_workfn+0xab4/0xe18 fs/fs-writeback.c:2321 process_one_work+0x7e4/0x13bc kernel/workqueue.c:2292 worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439 kthread+0x254/0x2e0 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 other info that might help us debug this: Chain exists of: jbd2_handle --> &ei->xattr_sem --> &sbi->s_writepages_rwsem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->s_writepages_rwsem); lock(&ei->xattr_sem); lock(&sbi->s_writepages_rwsem); lock(jbd2_handle); *** DEADLOCK *** 4 locks held by kworker/u4:4/1582: #0: ffff0000c2c34138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x69c/0x13bc kernel/workqueue.c:-1 #1: ffff8000255e7c40 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x6e8/0x13bc kernel/workqueue.c:2267 #2: ffff0000d83c00e0 (&type->s_umount_key#30){++++}-{3:3}, at: trylock_super+0x24/0xf4 fs/super.c:415 #3: ffff0000d83c2c18 (&sbi->s_writepages_rwsem){.+.+}-{0:0}, at: ext4_writepages+0x1b0/0x28fc fs/ext4/inode.c:2717 stack backtrace: CPU: 1 PID: 1582 Comm: kworker/u4:4 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026 Workqueue: writeback wb_workfn (flush-259:0) Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2048 check_noncircular+0x264/0x2f8 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063 lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5676 wait_transaction_locked+0x184/0x23c fs/jbd2/transaction.c:177 add_transaction_credits+0x104/0xaf0 fs/jbd2/transaction.c:-1 start_this_handle+0x4dc/0x125c fs/jbd2/transaction.c:422 jbd2__journal_start+0x288/0x530 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x2f8/0x66c fs/ext4/ext4_jbd2.c:105 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_writepages+0xa50/0x28fc fs/ext4/inode.c:2840 do_writepages+0x2c4/0x50c mm/page-writeback.c:2491 __writeback_single_inode+0x164/0x157c fs/fs-writeback.c:1673 writeback_sb_inodes+0x870/0x1470 fs/fs-writeback.c:1964 __writeback_inodes_wb+0x104/0x370 fs/fs-writeback.c:2035 wb_writeback+0x420/0xfdc fs/fs-writeback.c:2140 wb_check_old_data_flush fs/fs-writeback.c:2240 [inline] wb_do_writeback fs/fs-writeback.c:2293 [inline] wb_workfn+0xab4/0xe18 fs/fs-writeback.c:2321 process_one_work+0x7e4/0x13bc kernel/workqueue.c:2292 worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439 kthread+0x254/0x2e0 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850