loop0: detected capacity change from 0 to 32768 bcachefs (loop0): starting version 1.7: mi_btree_bitmap opts=metadata_checksum=none,data_checksum=none,compression=lz4,journal_flush_disabled,fsck,norecovery,reconstruct_alloc bcachefs (loop0): recovering from clean shutdown, journal seq 10 bcachefs (loop0): Version upgrade required: Version upgrade from 0.24: unwritten_extents to 1.7: mi_btree_bitmap incomplete Doing incompatible version upgrade from 0.24: unwritten_extents to 1.13: inode_has_child_snapshots running recovery passes: check_allocations,check_alloc_info,check_lrus,check_btree_backpointers,check_backpointers_to_extents,check_extents_to_backpointers,check_alloc_to_lru_refs,bucket_gens_init,check_snapshot_trees,check_snapshots,check_subvols,check_subvol_children,delete_dead_snapshots,check_inodes,check_extents,check_indirect_extents,check_dirents,check_xattrs,check_root,check_unreachable_inodes,check_subvolume_structure,check_directory_structure,check_nlinks,set_fs_needs_rebalance bcachefs (loop0): dropping and reconstructing all alloc info bcachefs (loop0): check_topology... done bcachefs (loop0): accounting_read... done bcachefs (loop0): alloc_read... done bcachefs (loop0): stripes_read... done bcachefs (loop0): snapshots_read... done bcachefs (loop0): check_allocations... done bcachefs (loop0): going read-write bcachefs (loop0): done starting filesystem ------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 10 < 1048576 WARNING: CPU: 0 PID: 5321 at fs/bcachefs/fs-io.c:428 bchfs_truncate+0xbca/0xc90 fs/bcachefs/fs-io.c:425 Modules linked in: CPU: 0 UID: 0 PID: 5321 Comm: syz.0.0 Not tainted 6.13.0-rc1-syzkaller-00002-gcdd30ebb1b9f #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:bchfs_truncate+0xbca/0xc90 fs/bcachefs/fs-io.c:425 Code: fc ff df 41 80 3c 06 00 74 08 48 89 df e8 1e 67 cb fd 48 8b 94 24 20 01 00 00 48 c7 c7 00 2a 52 8c 4c 89 fe e8 87 26 21 fd 90 <0f> 0b 90 90 e9 cf f9 ff ff e8 28 7f 60 fd 48 8b 5c 24 60 48 89 df RSP: 0018:ffffc900019bf500 EFLAGS: 00010246 RAX: 3df2f35994566c00 RBX: ffffc900019bf620 RCX: 0000000000100000 RDX: ffffc9000e272000 RSI: 0000000000001ce5 RDI: 0000000000001ce6 RBP: ffffc900019bf778 R08: ffffffff81601c02 R09: 1ffff11003f8519a R10: dffffc0000000000 R11: ffffed1003f8519b R12: 1ffff1100a5f7183 R13: ffff888052fb87d0 R14: 1ffff92000337ec4 R15: 000000000000000a FS: 00007efc905c16c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffdaf551c88 CR3: 0000000042fb6000 CR4: 0000000000352ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: notify_change+0xbca/0xe90 fs/attr.c:552 do_truncate+0x220/0x310 fs/open.c:65 handle_truncate fs/namei.c:3449 [inline] do_open fs/namei.c:3832 [inline] path_openat+0x2e1e/0x3590 fs/namei.c:3987 do_filp_open+0x27f/0x4e0 fs/namei.c:4014 do_sys_openat2+0x13e/0x1d0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_creat fs/open.c:1495 [inline] __se_sys_creat fs/open.c:1489 [inline] __x64_sys_creat+0x123/0x170 fs/open.c:1489 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:0x7efc8f77ff19 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:00007efc905c1058 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007efc8f945fa0 RCX: 00007efc8f77ff19 RDX: 0000000000000000 RSI: 00000000000000bc RDI: 00000000200000c0 RBP: 00007efc8f7f3986 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007efc8f945fa0 R15: 00007ffd3b88f2e8