------------[ cut here ]------------
WARNING: CPU: 1 PID: 6979 at fs/bcachefs/buckets.c:108 bch2_fs_usage_read_one+0x638/0x6a0 fs/bcachefs/buckets.c:108
Modules linked in:
CPU: 1 PID: 6979 Comm: syz-executor.2 Not tainted 6.9.0-rc7-next-20240507-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
RIP: 0010:bch2_fs_usage_read_one+0x638/0x6a0 fs/bcachefs/buckets.c:108
Code: 24 38 49 01 c7 4d 01 fc 4d 01 e5 4c 89 e8 48 81 c4 a0 00 00 00 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc e8 19 9e 78 fd 90 <0f> 0b 90 e9 ba fa ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 32 fa
RSP: 0018:ffffc90003416d48 EFLAGS: 00010246
RAX: ffffffff841d7b87 RBX: 0000000000000000 RCX: 0000000000040000
RDX: ffffc9000a243000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffffc90003416f30 R08: ffffffff841d7636 R09: 0000000000000000
R10: ffffc90003416e80 R11: fffff52000682dd5 R12: ffff88801ed95200
R13: dffffc0000000000 R14: ffff888056900000 R15: 0000000000000000
FS:  00007fbcfb8096c0(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f665457b038 CR3: 0000000079348000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bch2_fs_alloc_debug_to_text+0x181/0x630 fs/bcachefs/alloc_foreground.c:1634
 bch2_print_allocator_stuck+0xc9/0x180 fs/bcachefs/alloc_foreground.c:1657
 __bch2_write+0x5471/0x5c40 fs/bcachefs/io_write.c:1493
 bch2_write+0x947/0x1670 fs/bcachefs/io_write.c:1622
 closure_queue include/linux/closure.h:269 [inline]
 closure_call include/linux/closure.h:402 [inline]
 bch2_dio_write_loop fs/bcachefs/fs-io-direct.c:531 [inline]
 bch2_direct_write+0x1a52/0x3050 fs/bcachefs/fs-io-direct.c:652
 bch2_write_iter+0x206/0x2840 fs/bcachefs/fs-io-buffered.c:1135
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0xa72/0xc90 fs/read_write.c:590
 ksys_write+0x1a0/0x2c0 fs/read_write.c:643
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fbcfaa7dca9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbcfb8090c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fbcfabac050 RCX: 00007fbcfaa7dca9
RDX: 00000000175d9003 RSI: 0000000020000200 RDI: 0000000000000005
RBP: 00007fbcfaac947e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007fbcfabac050 R15: 00007ffed11e4098
 </TASK>