RSP: 002b:00007ffc24a20818 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f98133a6c49 RDX: 0000000000000020 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 00007ffc24a20860 R08: 0000000000000002 R09: aaaaaaaaaaaa0102 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 R13: 00007f981341977c R14: 0000000000000003 R15: 0000000000000001 ------------[ cut here ]------------ kernel BUG at fs/btrfs/extent-tree.c:3283! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 5072 Comm: syz-executor246 Not tainted 6.2.0-rc4-next-20230120-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 RIP: 0010:btrfs_free_tree_block+0x266/0x990 fs/btrfs/extent-tree.c:3283 Code: 00 48 8b 74 24 10 31 d2 4c 89 e7 e8 e4 a7 16 00 31 ff 89 c6 89 44 24 10 e8 27 84 23 fe 8b 44 24 10 85 c0 74 26 e8 6a 87 23 fe <0f> 0b e8 63 87 23 fe 48 89 ee 48 c7 c7 fa ff ff ff c6 44 24 58 01 RSP: 0018:ffffc90003d1ecb0 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff888029183930 RCX: 0000000000000000 RDX: ffff888029138000 RSI: ffffffff835e7276 RDI: 0000000000000005 RBP: 0000000000000005 R08: 0000000000000005 R09: 0000000000000000 R10: 00000000fffffff4 R11: 0000000000000000 R12: ffff888075bf3498 R13: 1ffff920007a3d9a R14: 0000000000000001 R15: ffff8880293e8000 FS: 0000555556ba93c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8730789aa0 CR3: 00000000287d0000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: btrfs_del_leaf+0x293/0x320 fs/btrfs/ctree.c:4353 btrfs_del_items+0x9f5/0xe20 fs/btrfs/ctree.c:4465 btrfs_drop_extents+0x1b37/0x2650 fs/btrfs/file.c:513 cow_file_range_inline+0x37e/0x7c0 fs/btrfs/inode.c:456 cow_file_range+0x987/0xd10 fs/btrfs/inode.c:1240 btrfs_run_delalloc_range+0x593/0x1340 fs/btrfs/inode.c:2249 writepage_delalloc+0x1a6/0x3e0 fs/btrfs/extent_io.c:1426 __extent_writepage+0xff0/0x1560 fs/btrfs/extent_io.c:1726 extent_write_cache_pages+0x445/0xd00 fs/btrfs/extent_io.c:2644 extent_writepages+0x1ae/0x450 fs/btrfs/extent_io.c:2764 do_writepages+0x1a8/0x640 mm/page-writeback.c:2551 filemap_fdatawrite_wbc mm/filemap.c:388 [inline] filemap_fdatawrite_wbc+0x147/0x1b0 mm/filemap.c:378 __filemap_fdatawrite_range+0xb8/0xf0 mm/filemap.c:421 btrfs_fdatawrite_range+0x4a/0x110 fs/btrfs/file.c:3857 btrfs_direct_write fs/btrfs/file.c:1603 [inline] btrfs_do_write_iter+0xf24/0x1470 fs/btrfs/file.c:1674 call_write_iter include/linux/fs.h:1851 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9ed/0xe10 fs/read_write.c:584 ksys_write+0x12b/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f98133a6c49 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 17 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc24a20818 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f98133a6c49 RDX: 0000000000000020 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 00007ffc24a20860 R08: 0000000000000002 R09: aaaaaaaaaaaa0102 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 R13: 00007f981341977c R14: 0000000000000003 R15: 0000000000000001 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:btrfs_free_tree_block+0x266/0x990 fs/btrfs/extent-tree.c:3283 Code: 00 48 8b 74 24 10 31 d2 4c 89 e7 e8 e4 a7 16 00 31 ff 89 c6 89 44 24 10 e8 27 84 23 fe 8b 44 24 10 85 c0 74 26 e8 6a 87 23 fe <0f> 0b e8 63 87 23 fe 48 89 ee 48 c7 c7 fa ff ff ff c6 44 24 58 01 RSP: 0018:ffffc90003d1ecb0 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff888029183930 RCX: 0000000000000000 RDX: ffff888029138000 RSI: ffffffff835e7276 RDI: 0000000000000005 RBP: 0000000000000005 R08: 0000000000000005 R09: 0000000000000000 R10: 00000000fffffff4 R11: 0000000000000000 R12: ffff888075bf3498 R13: 1ffff920007a3d9a R14: 0000000000000001 R15: ffff8880293e8000 FS: 0000555556ba93c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000056463f81d300 CR3: 00000000287d0000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400