Kernel bug: WARNING in __bch2_fsck_err
Subsystem: bcachefs
Status: fixed

Crash report:
bcachefs (loop0): accounting_read... done
bcachefs (loop0): alloc_read... done
bcachefs (loop0): stripes_read... done
bcachefs (loop0): snapshots_read... done
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5090 at fs/bcachefs/error.c:242 __bch2_fsck_err+0x130f/0x14f0 fs/bcachefs/error.c:242
Modules linked in:
CPU: 0 UID: 0 PID: 5090 Comm: syz-executor348 Not tainted 6.11.0-rc3-syzkaller-00066-g1fb918967b56 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:__bch2_fsck_err+0x130f/0x14f0 fs/bcachefs/error.c:242
Code: 25 df f5 41 bc 5d f7 ff ff c7 44 24 10 00 00 00 00 e9 83 fa ff ff e8 c0 25 df f5 90 0f 0b 90 e9 4f ee ff ff e8 b2 25 df f5 90 <0f> 0b 90 e9 98 ee ff ff 89 f9 80 e1 07 38 c1 0f 8c d4 ed ff ff e8
RSP: 0018:ffffc9000b056f00 EFLAGS: 00010293
RAX: ffffffff8bb463be RBX: 0000000000000000 RCX: ffff88801a9c4880
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffc9000b056e40
RBP: ffffc9000b0570a8 R08: ffffc9000b056e47 R09: 1ffff9200160adc8
R10: dffffc0000000000 R11: fffff5200160adc9 R12: 0000000000000071
R13: dffffc0000000000 R14: 0000000000000071 R15: 0000000000000006
FS:  000055558f5d5380(0000) GS:ffff888020800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f86d3431ad8 CR3: 00000000399b4000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __bch2_trans_mark_metadata_bucket fs/bcachefs/buckets.c:914 [inline]
 bch2_trans_mark_metadata_bucket+0x5d2/0x1640 fs/bcachefs/buckets.c:999
 __bch2_trans_mark_dev_sb fs/bcachefs/buckets.c:1066 [inline]
 bch2_trans_mark_dev_sb+0x520/0x720 fs/bcachefs/buckets.c:1079
 bch2_trans_mark_dev_sbs_flags+0x6be/0x720 fs/bcachefs/buckets.c:1089
 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:183
 bch2_run_recovery_passes+0x19e/0x820 fs/bcachefs/recovery_passes.c:230
 bch2_fs_recovery+0x25e8/0x38d0 fs/bcachefs/recovery.c:852
 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1036
 bch2_fs_get_tree+0xd61/0x1700 fs/bcachefs/fs.c:1946
 vfs_get_tree+0x90/0x2a0 fs/super.c:1800
 do_new_mount+0x2be/0xb40 fs/namespace.c:3472
 do_mount fs/namespace.c:3812 [inline]
 __do_sys_mount fs/namespace.c:4020 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcdecacfeaa
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007ffe0e399998 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffe0e3999b0 RCX: 00007fcdecacfeaa
RDX: 00000000200058c0 RSI: 0000000020005900 RDI: 00007ffe0e3999b0
RBP: 0000000000000004 R08: 00007ffe0e3999f0 R09: 00000000000058a9
R10: 0000000000000000 R11: 0000000000000282 R12: 0000000000000000
R13: 00007ffe0e3999f0 R14: 0000000000000003 R15: 0000000001000000
 </TASK>