R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007fff23f4b47f R14: 00007f2158fcc300 R15: 0000000000022000 ------------[ cut here ]------------ kernel BUG at fs/btrfs/extent-io-tree.c:515! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 3 PID: 29854 Comm: syz-executor.1 Not tainted 6.4.0-rc4-syzkaller-00078-g929ed21dfdb6 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 RIP: 0010:clear_state_bit+0x31b/0x3a0 fs/btrfs/extent-io-tree.c:515 Code: 14 02 4c 89 f0 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 33 44 8b 7d 7c e9 af fe ff ff e8 2e 77 f8 fd 0f 0b eb 97 e8 25 77 f8 fd <0f> 0b 4c 89 f7 e8 fb 48 4a fe e9 72 fd ff ff 4c 89 f7 e8 ee 48 4a RSP: 0018:ffffc90029e7f218 EFLAGS: 00010246 RAX: 0000000000040000 RBX: 00000000fffffff4 RCX: ffffc90005ab9000 RDX: 0000000000040000 RSI: ffffffff838aee1b RDI: 0000000000000005 RBP: ffff888025f380c0 R08: 0000000000000005 R09: 0000000000000000 R10: 00000000fffffff4 R11: 6637303030302052 R12: ffff88803024a340 R13: 0000000000000000 R14: ffff888025f3813c R15: 0000000000001fff FS: 00007f2158fcc700(0000) GS:ffff88806b900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2158fcbff8 CR3: 0000000107916000 CR4: 0000000000350ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __clear_extent_bit+0x560/0xba0 fs/btrfs/extent-io-tree.c:674 clear_record_extent_bits+0x58/0x90 fs/btrfs/extent-io-tree.c:1703 __btrfs_qgroup_release_data+0x30a/0x8f0 fs/btrfs/qgroup.c:3910 btrfs_invalidate_folio+0x5e4/0xa10 fs/btrfs/inode.c:8034 folio_invalidate mm/truncate.c:159 [inline] truncate_cleanup_folio+0x31a/0x3f0 mm/truncate.c:179 truncate_inode_pages_range+0x238/0xf10 mm/truncate.c:368 truncate_inode_pages mm/truncate.c:449 [inline] truncate_pagecache+0x67/0x90 mm/truncate.c:744 btrfs_setsize fs/btrfs/inode.c:5041 [inline] btrfs_setattr+0x382/0x1430 fs/btrfs/inode.c:5080 notify_change+0xb2c/0x1180 fs/attr.c:483 do_truncate+0x143/0x200 fs/open.c:66 handle_truncate fs/namei.c:3295 [inline] do_open fs/namei.c:3640 [inline] path_openat+0x2083/0x2750 fs/namei.c:3791 do_filp_open+0x1ba/0x410 fs/namei.c:3818 do_sys_openat2+0x16d/0x4c0 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_creat fs/open.c:1448 [inline] __se_sys_creat fs/open.c:1442 [inline] __x64_sys_creat+0xcd/0x120 fs/open.c:1442 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:0x7f215828c169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2158fcc168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f21583ac050 RCX: 00007f215828c169 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000180 RBP: 00007f2158fcc1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007fff23f4b47f R14: 00007f2158fcc300 R15: 0000000000022000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:clear_state_bit+0x31b/0x3a0 fs/btrfs/extent-io-tree.c:515 Code: 14 02 4c 89 f0 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 33 44 8b 7d 7c e9 af fe ff ff e8 2e 77 f8 fd 0f 0b eb 97 e8 25 77 f8 fd <0f> 0b 4c 89 f7 e8 fb 48 4a fe e9 72 fd ff ff 4c 89 f7 e8 ee 48 4a RSP: 0018:ffffc90029e7f218 EFLAGS: 00010246 RAX: 0000000000040000 RBX: 00000000fffffff4 RCX: ffffc90005ab9000 RDX: 0000000000040000 RSI: ffffffff838aee1b RDI: 0000000000000005 RBP: ffff888025f380c0 R08: 0000000000000005 R09: 0000000000000000 R10: 00000000fffffff4 R11: 6637303030302052 R12: ffff88803024a340 R13: 0000000000000000 R14: ffff888025f3813c R15: 0000000000001fff FS: 00007f2158fcc700(0000) GS:ffff88806b900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2158fcbff8 CR3: 0000000107916000 CR4: 0000000000350ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400