btree ptr not marked in member info btree allocated bitmap u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq e81e1ed936acf3df written 21 min_key POS_MIN durability: 1 ptr: 0:29:0 gen 0, fixing bucket 0:37 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 4a8b0fa43a9980a6 written 24 min_key POS_MIN durability: 1 ptr: 0:37:0 gen 0, fixing bucket 0:7 gen 0 has wrong data_type: got free, should be sb, fixing bucket 0:7 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bucket 0:21 gen 0 has wrong data_type: got free, should be sb, fixing bucket 0:21 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bucket 0:27 gen 0 has wrong data_type: got free, should be btree, fixing bucket 0:27 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing bucket 0:28 gen 0 has wrong data_type: got free, should be btree, fixing bucket 0:28 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing bucket 0:31 gen 0 has wrong data_type: got free, should be btree, fixing bucket 0:31 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing bucket 0:34 gen 0 has wrong data_type: got free, should be user, fixing bucket 0:34 gen 0 data type user has wrong dirty_sectors: got 0, should be 16, fixing bucket 0:37 gen 0 has wrong data_type: got free, should be btree, fixing bucket 0:37 gen 0 data type btree has wrong dirty_sectors: got 0, should be 256, fixing done bcachefs (loop0): going read-write bcachefs (loop0): journal_replay... done bcachefs (loop0): check_inodes... done bcachefs (loop0): resume_logged_ops... done bcachefs (loop0): delete_dead_inodes... done bcachefs (loop0): done starting filesystem bcachefs (loop0): non free bucket in freespace btree freespace key u64s 5 type set 0:28:0 len 1 ver 0 u64s 13 type alloc_v4 0:27:0 len 0 ver 0: gen 0 oldest_gen 0 data_type btree journal_seq 0 need_discard 0 need_inc_gen 0 dirty_sectors 256 stripe_sectors 0 cached_sectors 0 stripe 0 stripe_redundancy 0 io_time[READ] 0 io_time[WRITE] 0 fragmentation 0 bp_start 8 2 transaction updates for bch2_truncate journal seq 0 update: btree=logged_ops cached=0 __bch2_logged_op_start fs/bcachefs/logged_ops.c:85 [inline] update: btree=logged_ops cached=0 bch2_logged_op_start+0x181/0x310 fs/bcachefs/logged_ops.c:92 old u64s 5 type deleted 0:1:0 len 0 ver 0 new u64s 8 type logged_op_truncate 0:1:0 len 0 ver 0: subvol=1 inum=4099 new_i_size=0 update: btree=logged_ops cached=1 __bch2_logged_op_start fs/bcachefs/logged_ops.c:85 [inline] update: btree=logged_ops cached=1 bch2_logged_op_start+0x181/0x310 fs/bcachefs/logged_ops.c:92 old u64s 5 type deleted 0:1:0 len 0 ver 0 new u64s 8 type logged_op_truncate 0:1:0 len 0 ver 0: subvol=1 inum=4099 new_i_size=0 bcachefs (loop0): bch2_btree_update_start(): error EIO ------------[ cut here ]------------ WARNING: CPU: 0 PID: 5330 at fs/bcachefs/fs-io-buffered.c:419 bch2_writepage_io_done+0x614/0x670 fs/bcachefs/fs-io-buffered.c:419 Modules linked in: CPU: 0 UID: 0 PID: 5330 Comm: syz.0.0 Not tainted 6.12.0-rc5-syzkaller-00322-gb9021de3ec2f #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_writepage_io_done+0x614/0x670 fs/bcachefs/fs-io-buffered.c:419 Code: 8b 04 25 28 00 00 00 48 3b 84 24 c0 00 00 00 75 6b 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc e8 1d d8 60 fd 90 <0f> 0b 90 42 80 3c 33 00 74 08 4c 89 ff e8 ca 96 ca fd 4d 8b 2f e9 RSP: 0018:ffffc9000d1ef180 EFLAGS: 00010287 RAX: ffffffff84340183 RBX: 1ffff11009fd1323 RCX: 0000000000040000 RDX: ffffc9000d799000 RSI: 0000000000004ed6 RDI: 0000000000004ed7 RBP: ffffc9000d1ef290 R08: ffffffff8433ffd5 R09: 1ffff1100686f440 R10: dffffc0000000000 R11: ffffed100686f441 R12: ffff88803437a200 R13: 0000000000000008 R14: dffffc0000000000 R15: ffff88804fe89918 FS: 00007f6279f5b6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6279f39f98 CR3: 00000000009e2000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: bch2_write_data_inline fs/bcachefs/io_write.c:1561 [inline] bch2_write+0x1022/0x1760 fs/bcachefs/io_write.c:1630 closure_queue include/linux/closure.h:270 [inline] closure_call include/linux/closure.h:432 [inline] bch2_writepage_do_io fs/bcachefs/fs-io-buffered.c:449 [inline] bch2_writepages+0x27d/0x380 fs/bcachefs/fs-io-buffered.c:641 do_writepages+0x35d/0x870 mm/page-writeback.c:2683 filemap_fdatawrite_wbc+0x125/0x180 mm/filemap.c:398 __filemap_fdatawrite_range mm/filemap.c:431 [inline] filemap_write_and_wait_range+0x192/0x280 mm/filemap.c:685 bchfs_truncate+0x78d/0xc90 notify_change+0xbca/0xe90 fs/attr.c:503 do_truncate+0x220/0x310 fs/open.c:65 vfs_truncate+0x2e1/0x3b0 fs/open.c:111 do_sys_truncate+0xdb/0x190 fs/open.c:134 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:0x7f627917e719 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6279f5b038 EFLAGS: 00000246 ORIG_RAX: 000000000000004c RAX: ffffffffffffffda RBX: 00007f6279335f80 RCX: 00007f627917e719 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000020000280 RBP: 00007f62791f132e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f6279335f80 R15: 00007ffd80815738