------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 8192 < 1048576 WARNING: CPU: 1 PID: 8756 at fs/bcachefs/fs-io.c:474 bchfs_truncate+0x870/0xa40 fs/bcachefs/fs-io.c:471 Modules linked in: CPU: 1 UID: 0 PID: 8756 Comm: syz.2.251 Not tainted 6.16.0-rc5-syzkaller-gec4801305969 #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 : ffff80009c827700 x29: ffff80009c827950 x28: 0000000000100000 x27: ffff0000f7e22628 x26: ffff0000f7e22aa0 x25: ffff80009c827ad0 x24: ffff700013904ef0 x23: 0000000000002000 x22: ffff0000f7e22b60 x21: ffff0000f7e22a98 x20: dfff800000000000 x19: ffff0000f7e225f8 x18: 1fffe000337d8876 x17: 0000000000000000 x16: ffff80008aefc458 x15: 0000000000000001 x14: 1fffe000337d88e2 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000080000 x10: 0000000000002941 x9 : 96fd3043a1015b00 x8 : 96fd3043a1015b00 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff80009c827058 x4 : ffff80008f766be0 x3 : ffff8000807bcfac 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:1241 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/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: 228 hardirqs last enabled at (227): [] __up_console_sem kernel/printk/printk.c:344 [inline] hardirqs last enabled at (227): [] __console_unlock+0x70/0xc4 kernel/printk/printk.c:2885 hardirqs last disabled at (228): [] el1_brk64+0x1c/0x48 arch/arm64/kernel/entry-common.c:574 softirqs last enabled at (152): [] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32 softirqs last disabled at (150): [] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19 ---[ end trace 0000000000000000 ]---