------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 65007 < 1048576 WARNING: CPU: 0 PID: 6809 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: 6809 Comm: syz.3.10 Not tainted 6.16.0-rc6-syzkaller-gaaef6f251176 #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 : ffff8000a0b97340 x29: ffff8000a0b97590 x28: 0000000000100000 x27: ffff0000f6e596f8 x26: ffff0000f6e59b70 x25: ffff8000a0b97710 x24: ffff700014172e78 x23: 000000000000fdef x22: ffff0000f6e59c30 x21: ffff0000f6e59b68 x20: dfff800000000000 x19: ffff0000f6e596c8 x18: 00000000ffffffff x17: 0000000000000000 x16: ffff80008ae67e88 x15: ffff700011ee0158 x14: 1ffff00011ee0158 x13: 0000000000000004 x12: ffffffffffffffff x11: 0000000000080000 x10: 000000000000412c x9 : 0c6c75fef4873600 x8 : 0c6c75fef4873600 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff8000a0b96c98 x4 : ffff80008f776bc0 x3 : ffff80008054bf18 x2 : 0000000000000000 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:1241 notify_change+0x9a4/0xc50 fs/attr.c:552 do_truncate+0x198/0x210 fs/open.c:68 handle_truncate fs/namei.c:3517 [inline] do_open fs/namei.c:3900 [inline] path_openat+0x25a0/0x2c40 fs/namei.c:4055 do_filp_open+0x18c/0x36c fs/namei.c:4082 do_sys_openat2+0x11c/0x1b4 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __arm64_sys_openat+0x120/0x158 fs/open.c:1463 __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/0x180 arch/arm64/kernel/entry-common.c:879 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596 irq event stamp: 148 hardirqs last enabled at (147): [] __up_console_sem kernel/printk/printk.c:344 [inline] hardirqs last enabled at (147): [] __console_unlock+0x70/0xc4 kernel/printk/printk.c:2885 hardirqs last disabled at (148): [] el1_brk64+0x1c/0x48 arch/arm64/kernel/entry-common.c:574 softirqs last enabled at (8): [] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32 softirqs last disabled at (6): [] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19 ---[ end trace 0000000000000000 ]---