------------[ cut here ]------------ btrfs_abort_should_print_stack(__error) WARNING: fs/btrfs/block-group.c:2944 at btrfs_create_pending_block_groups+0x13d8/0x15e0 fs/btrfs/block-group.c:2944, CPU#0: kworker/u4:2/36 Modules linked in: CPU: 0 UID: 0 PID: 36 Comm: kworker/u4:2 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: btrfs-qgroup-rescan btrfs_work_helper RIP: 0010:btrfs_create_pending_block_groups+0x13d8/0x15e0 fs/btrfs/block-group.c:2944 Code: 83 fb f4 75 63 e8 e8 18 89 fd eb 65 e8 e1 18 89 fd eb 1a e8 da 18 89 fd 49 be 00 00 00 00 00 fc ff df eb 09 e8 c9 18 89 fd 90 <0f> 0b 90 f7 db e9 47 fd ff ff e8 b9 18 89 fd eb 10 e8 b2 18 89 fd RSP: 0000:ffffc900003e74c0 EFLAGS: 00010293 RAX: ffffffff843e1bf7 RBX: 00000000ffffffe4 RCX: ffff88801f130000 RDX: 0000000000000000 RSI: ffffffff8f4064d0 RDI: 00000000ffffffe4 RBP: ffffc900003e7740 R08: ffff88801f130000 R09: 0000000000000003 R10: 00000000fffffffb R11: 0000000000000000 R12: ffff88800bf9a150 R13: fffff5200007ceb4 R14: dffffc0000000000 R15: ffff88800bf9a318 FS: 0000000000000000(0000) GS:ffff88808c30a000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f9f46ceb000 CR3: 000000000eb46000 CR4: 0000000000352ef0 Call Trace: __btrfs_end_transaction+0x140/0x640 fs/btrfs/transaction.c:1090 btrfs_qgroup_rescan_worker+0x1e6f/0x23d0 fs/btrfs/qgroup.c:3945 btrfs_work_helper+0x3a2/0xc50 fs/btrfs/async-thread.c:312 process_one_work kernel/workqueue.c:3387 [inline] process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3470 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3551 kthread+0x38b/0x480 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245