RBP: 00007f677ed73120 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 000000000000000b R14: 00007f677e19bf80 R15: 00007ffcfe80d988 ====================================================== WARNING: possible circular locking dependency detected 6.6.0-rc5-syzkaller-00216-g95535e37e895 #0 Not tainted ------------------------------------------------------ syz-executor.4/27750 is trying to acquire lock: ffffffff8cd15fc0 (fs_reclaim){+.+.}-{0:0}, at: might_alloc include/linux/sched/mm.h:303 [inline] ffffffff8cd15fc0 (fs_reclaim){+.+.}-{0:0}, at: slab_pre_alloc_hook mm/slab.h:709 [inline] ffffffff8cd15fc0 (fs_reclaim){+.+.}-{0:0}, at: slab_alloc_node mm/slub.c:3460 [inline] ffffffff8cd15fc0 (fs_reclaim){+.+.}-{0:0}, at: slab_alloc mm/slub.c:3486 [inline] ffffffff8cd15fc0 (fs_reclaim){+.+.}-{0:0}, at: __kmem_cache_alloc_lru mm/slub.c:3493 [inline] ffffffff8cd15fc0 (fs_reclaim){+.+.}-{0:0}, at: kmem_cache_alloc+0x4f/0x3b0 mm/slub.c:3502 but task is already holding lock: ffff888079855288 (&ei->i_data_sem){++++}-{3:3}, at: ext4_da_map_blocks fs/ext4/inode.c:1735 [inline] ffff888079855288 (&ei->i_data_sem){++++}-{3:3}, at: ext4_da_get_block_prep+0x6c9/0x1340 fs/ext4/inode.c:1813 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&ei->i_data_sem){++++}-{3:3}: down_write+0x93/0x200 kernel/locking/rwsem.c:1573 ext4_truncate+0xcf5/0x12b0 fs/ext4/inode.c:4156 ext4_setattr+0x1a09/0x2990 fs/ext4/inode.c:5468 notify_change+0x742/0x11c0 fs/attr.c:499 do_truncate+0x15c/0x220 fs/open.c:66 do_sys_ftruncate+0x6a2/0x790 fs/open.c:194 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #2 (jbd2_handle){++++}-{0:0}: start_this_handle+0x10fc/0x15e0 fs/jbd2/transaction.c:463 jbd2__journal_start+0x391/0x690 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x40f/0x5c0 fs/ext4/ext4_jbd2.c:112 ext4_sample_last_mounted fs/ext4/file.c:856 [inline] ext4_file_open+0x632/0xc80 fs/ext4/file.c:885 do_dentry_open+0x88b/0x1730 fs/open.c:929 do_open fs/namei.c:3639 [inline] path_openat+0x19af/0x29c0 fs/namei.c:3796 do_filp_open+0x1de/0x430 fs/namei.c:3823 do_sys_openat2+0x176/0x1e0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (sb_internal){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1571 [inline] sb_start_intwrite include/linux/fs.h:1693 [inline] ext4_evict_inode+0xe55/0x1a30 fs/ext4/inode.c:212 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 shrink_dentry_list+0x22b/0x7d0 fs/dcache.c:1201 prune_dcache_sb+0xeb/0x150 fs/dcache.c:1282 super_cache_scan+0x31f/0x540 fs/super.c:228 do_shrink_slab+0x422/0xaa0 mm/vmscan.c:900 shrink_slab_memcg mm/vmscan.c:969 [inline] shrink_slab+0x48b/0x6e0 mm/vmscan.c:1048 shrink_one+0x4f7/0x700 mm/vmscan.c:5417 shrink_many mm/vmscan.c:5469 [inline] lru_gen_shrink_node mm/vmscan.c:5586 [inline] shrink_node+0x20d4/0x37a0 mm/vmscan.c:6526 kswapd_shrink_node mm/vmscan.c:7331 [inline] balance_pgdat+0xa32/0x1b80 mm/vmscan.c:7521 kswapd+0x5be/0xbf0 mm/vmscan.c:7781 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 -> #0 (fs_reclaim){+.+.}-{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:3868 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 __fs_reclaim_acquire mm/page_alloc.c:3551 [inline] fs_reclaim_acquire+0x100/0x150 mm/page_alloc.c:3565 might_alloc include/linux/sched/mm.h:303 [inline] slab_pre_alloc_hook mm/slab.h:709 [inline] slab_alloc_node mm/slub.c:3460 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x4f/0x3b0 mm/slub.c:3502 kmem_cache_zalloc include/linux/slab.h:710 [inline] __es_alloc_extent fs/ext4/extents_status.c:469 [inline] ext4_es_insert_delayed_block+0x42e/0x610 fs/ext4/extents_status.c:2054 ext4_insert_delayed_block fs/ext4/inode.c:1664 [inline] ext4_da_map_blocks fs/ext4/inode.c:1752 [inline] ext4_da_get_block_prep+0x850/0x1340 fs/ext4/inode.c:1813 ext4_block_write_begin+0x3da/0xf10 fs/ext4/inode.c:1043 ext4_da_write_begin+0x40a/0x8c0 fs/ext4/inode.c:2890 generic_perform_write+0x278/0x600 mm/filemap.c:3969 ext4_buffered_write_iter+0x11f/0x3c0 fs/ext4/file.c:299 ext4_file_write_iter+0x7f7/0x1860 fs/ext4/file.c:717 call_write_iter include/linux/fs.h:1956 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: fs_reclaim --> jbd2_handle --> &ei->i_data_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&ei->i_data_sem); lock(jbd2_handle); lock(&ei->i_data_sem); lock(fs_reclaim); *** DEADLOCK *** 4 locks held by syz-executor.4/27750: #0: ffff888025e599c8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0xe7/0x170 fs/file.c:1064 #1: ffff88807f400410 (sb_writers#4){.+.+}-{0:0}, at: ksys_write+0x12f/0x250 fs/read_write.c:637 #2: ffff888079855400 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline] #2: ffff888079855400 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_buffered_write_iter+0xb0/0x3c0 fs/ext4/file.c:294 #3: ffff888079855288 (&ei->i_data_sem){++++}-{3:3}, at: ext4_da_map_blocks fs/ext4/inode.c:1735 [inline] #3: ffff888079855288 (&ei->i_data_sem){++++}-{3:3}, at: ext4_da_get_block_prep+0x6c9/0x1340 fs/ext4/inode.c:1813 stack backtrace: CPU: 0 PID: 27750 Comm: syz-executor.4 Not tainted 6.6.0-rc5-syzkaller-00216-g95535e37e895 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x311/0x3f0 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:3868 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 __fs_reclaim_acquire mm/page_alloc.c:3551 [inline] fs_reclaim_acquire+0x100/0x150 mm/page_alloc.c:3565 might_alloc include/linux/sched/mm.h:303 [inline] slab_pre_alloc_hook mm/slab.h:709 [inline] slab_alloc_node mm/slub.c:3460 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x4f/0x3b0 mm/slub.c:3502 kmem_cache_zalloc include/linux/slab.h:710 [inline] __es_alloc_extent fs/ext4/extents_status.c:469 [inline] ext4_es_insert_delayed_block+0x42e/0x610 fs/ext4/extents_status.c:2054 ext4_insert_delayed_block fs/ext4/inode.c:1664 [inline] ext4_da_map_blocks fs/ext4/inode.c:1752 [inline] ext4_da_get_block_prep+0x850/0x1340 fs/ext4/inode.c:1813 ext4_block_write_begin+0x3da/0xf10 fs/ext4/inode.c:1043 ext4_da_write_begin+0x40a/0x8c0 fs/ext4/inode.c:2890 generic_perform_write+0x278/0x600 mm/filemap.c:3969 ext4_buffered_write_iter+0x11f/0x3c0 fs/ext4/file.c:299 ext4_file_write_iter+0x7f7/0x1860 fs/ext4/file.c:717 call_write_iter include/linux/fs.h:1956 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f677e07cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f677ed730c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f677e19bf80 RCX: 00007f677e07cae9 RDX: 0000000000000012 RSI: 0000000020000080 RDI: 0000000000000003 RBP: 00007f677ed73120 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 000000000000000b R14: 00007f677e19bf80 R15: 00007ffcfe80d988