------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 8 < 1048576 WARNING: CPU: 0 PID: 6902 at fs/bcachefs/fs-io.c:474 bchfs_truncate+0x870/0xa40 fs/bcachefs/fs-io.c:471 Modules linked in: CPU: 0 UID: 0 PID: 6902 Comm: syz.2.60 Not tainted 6.16.0-rc2-syzkaller-g9aa9b43d689e #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : bchfs_truncate+0x870/0xa40 fs/bcachefs/fs-io.c:471 lr : bchfs_truncate+0x870/0xa40 fs/bcachefs/fs-io.c:471 sp : ffff8000a21b7700 x29: ffff8000a21b7950 x28: 0000000000100000 x27: ffff0000f7790f60 x26: ffff0000f77913d8 x25: ffff8000a21b7ad0 x24: ffff700014436ef0 x23: 0000000000000008 x22: ffff0000f7791498 x21: ffff0000f77913d0 x20: dfff800000000000 x19: ffff0000f7790f30 x18: 00000000ffffffff x17: 0000000000000000 x16: ffff80008aecb65c x15: 0000000000000001 x14: 1fffe000337dc8e2 x13: 0000000000000000 x12: 0000000000000000 x11: ffff6000337dc8e3 x10: 0000000000ff0100 x9 : 859fc0d37cdfc400 x8 : 859fc0d37cdfc400 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff8000a21b7058 x4 : ffff80008f727060 x3 : ffff8000807bef2c x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000 Call trace: bchfs_truncate+0x870/0xa40 fs/bcachefs/fs-io.c:471 (P) bch2_setattr+0x198/0x20c fs/bcachefs/fs.c:1243 notify_change+0x9a4/0xc50 fs/attr.c:552 do_truncate+0x198/0x210 fs/open.c:68 vfs_truncate+0x398/0x444 fs/open.c:118 do_sys_truncate+0xe4/0x1a8 fs/open.c:141 __do_sys_truncate fs/open.c:153 [inline] __se_sys_truncate fs/open.c:151 [inline] __arm64_sys_truncate+0x5c/0x74 fs/open.c:151 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x17c arch/arm64/kernel/entry-common.c:767 el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:786 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 irq event stamp: 56832 hardirqs last enabled at (56831): [] __up_console_sem kernel/printk/printk.c:344 [inline] hardirqs last enabled at (56831): [] __console_unlock+0x70/0xc4 kernel/printk/printk.c:2885 hardirqs last disabled at (56832): [] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:511 softirqs last enabled at (56734): [] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32 softirqs last disabled at (56732): [] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19 ---[ end trace 0000000000000000 ]---