R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 R13: 00007ffcf36346b0 R14: 00007ffcf3634690 R15: 0000000000000004 ------------[ cut here ]------------ kernel BUG at fs/btrfs/extent-tree.c:3274! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 3721 Comm: syz-executor243 Not tainted 6.1.0-rc7-syzkaller-00123-ga4412fdd49dc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 RIP: 0010:btrfs_free_tree_block+0x9b4/0x9c0 fs/btrfs/extent-tree.c:3274 Code: 44 89 e9 80 e1 07 38 c1 0f 8c fb fb ff ff be 08 00 00 00 4c 89 ef e8 8b fe 5c fe e9 e9 fb ff ff e8 41 7e 10 07 e8 bc e1 08 fe <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 55 41 57 41 56 41 55 41 54 53 RSP: 0018:ffffc9000436e860 EFLAGS: 00010293 RAX: ffffffff8381b634 RBX: 00000000fffffff4 RCX: ffff8880272f8000 RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000 RBP: ffffc9000436e9b8 R08: ffffffff8381b048 R09: fffffbfff1a42e8f R10: fffffbfff1a42e8f R11: 1ffffffff1a42e8e R12: dffffc0000000000 R13: ffffc9000436e8e0 R14: ffff88807e7c3e30 R15: ffff88807e7c3d10 FS: 0000555556064300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000557180d19c28 CR3: 000000002359d000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: btrfs_del_leaf+0x245/0x3c0 fs/btrfs/ctree.c:4266 btrfs_del_items+0xb47/0xe00 fs/btrfs/ctree.c:4383 btrfs_drop_extents+0x27c4/0x3550 fs/btrfs/file.c:823 cow_file_range_inline+0x41b/0x920 fs/btrfs/inode.c:434 cow_file_range+0x391/0xfa0 fs/btrfs/inode.c:1219 btrfs_run_delalloc_range+0xed4/0x11a0 fs/btrfs/inode.c:2229 writepage_delalloc+0x25e/0x540 fs/btrfs/extent_io.c:1968 __extent_writepage+0x5d6/0x14d0 fs/btrfs/extent_io.c:2272 extent_write_cache_pages+0x9e7/0x12d0 fs/btrfs/extent_io.c:3186 extent_writepages+0x228/0x550 fs/btrfs/extent_io.c:3308 do_writepages+0x3c3/0x680 mm/page-writeback.c:2469 filemap_fdatawrite_wbc+0x11e/0x170 mm/filemap.c:388 __filemap_fdatawrite_range mm/filemap.c:421 [inline] filemap_fdatawrite_range+0x175/0x200 mm/filemap.c:439 btrfs_fdatawrite_range fs/btrfs/file.c:4155 [inline] btrfs_direct_write fs/btrfs/file.c:1909 [inline] btrfs_do_write_iter+0xf0c/0x1260 fs/btrfs/file.c:1980 call_write_iter include/linux/fs.h:2199 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x7dc/0xc50 fs/read_write.c:584 ksys_write+0x177/0x2a0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f6153d39ba9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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:00007ffcf3634648 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f6153d39ba9 RDX: 0000000000000020 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 00007ffcf3634670 R08: 0000000000000002 R09: 00007ffcf3634680 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 R13: 00007ffcf36346b0 R14: 00007ffcf3634690 R15: 0000000000000004 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:btrfs_free_tree_block+0x9b4/0x9c0 fs/btrfs/extent-tree.c:3274 Code: 44 89 e9 80 e1 07 38 c1 0f 8c fb fb ff ff be 08 00 00 00 4c 89 ef e8 8b fe 5c fe e9 e9 fb ff ff e8 41 7e 10 07 e8 bc e1 08 fe <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 55 41 57 41 56 41 55 41 54 53 RSP: 0018:ffffc9000436e860 EFLAGS: 00010293 RAX: ffffffff8381b634 RBX: 00000000fffffff4 RCX: ffff8880272f8000 RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000 RBP: ffffc9000436e9b8 R08: ffffffff8381b048 R09: fffffbfff1a42e8f R10: fffffbfff1a42e8f R11: 1ffffffff1a42e8e R12: dffffc0000000000 R13: ffffc9000436e8e0 R14: ffff88807e7c3e30 R15: ffff88807e7c3d10 FS: 0000555556064300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005639f6e7d318 CR3: 000000002359d000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400