[syzbot] WARNING in do_chunk_alloc

From: syzbot
Date: Wed Nov 23 2022 - 01:38:46 EST


Hello,

syzbot found the following issue on:

HEAD commit: eb7081409f94 Linux 6.1-rc6
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=17b83119880000
kernel config: https://syzkaller.appspot.com/x/.config?x=8cdf448d3b35234
dashboard link: https://syzkaller.appspot.com/bug?extid=88247ec7a18c953867d5
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10b80ab1880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12dd6d45880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/4a019f55c517/disk-eb708140.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/eb36e890aa8b/vmlinux-eb708140.xz
kernel image: https://storage.googleapis.com/syzbot-assets/feee2c23ec64/bzImage-eb708140.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/f765e3fd06e2/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+88247ec7a18c953867d5@xxxxxxxxxxxxxxxxxxxxxxxxx

------------[ cut here ]------------
WARNING: CPU: 0 PID: 102 at fs/btrfs/block-group.c:3535 do_chunk_alloc+0x653/0x6c0 fs/btrfs/block-group.c:3535
Modules linked in:
CPU: 1 PID: 102 Comm: kworker/u4:4 Not tainted 6.1.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Workqueue: events_unbound btrfs_async_reclaim_metadata_space
RIP: 0010:do_chunk_alloc+0x653/0x6c0 fs/btrfs/block-group.c:3535
Code: 3d 8b 44 89 fe 31 c0 e8 cb a1 a0 fd 0f 0b b3 01 e9 fd fe ff ff e8 bd 03 d9 fd 48 c7 c7 a0 a9 3d 8b 89 de 31 c0 e8 ad a1 a0 fd <0f> 0b 40 b5 01 e9 fa fe ff ff e8 9e 03 d9 fd 48 c7 c7 a0 a9 3d 8b
RSP: 0018:ffffc900015c7870 EFLAGS: 00010246
RAX: 3ba9b5084e06eb00 RBX: ffffffffffffffe4 RCX: ffff88801981ba80
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffff88801e4dc001 R08: ffffffff816e568d R09: ffffed1017304f1b
R10: ffffed1017304f1b R11: 1ffff11017304f1a R12: ffff8880733f02a0
R13: ffff888147573000 R14: 1ffff1100e67e05e R15: 00000000ffffffe4
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000556f9b0c86a8 CR3: 0000000028162000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
btrfs_chunk_alloc+0x6a4/0x900 fs/btrfs/block-group.c:3777
flush_space+0x9d8/0xbc0 fs/btrfs/space-info.c:769
btrfs_async_reclaim_metadata_space+0x8e8/0xa50 fs/btrfs/space-info.c:1083
process_one_work+0x877/0xdb0 kernel/workqueue.c:2289
worker_thread+0xb14/0x1330 kernel/workqueue.c:2436
kthread+0x266/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxx.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches