------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 10 < 1048576 WARNING: CPU: 0 PID: 6742 at fs/bcachefs/fs-io.c:472 bchfs_truncate+0x88c/0xa70 fs/bcachefs/fs-io.c:469 Modules linked in: CPU: 0 UID: 0 PID: 6742 Comm: syz.3.25 Not tainted 6.15.0-rc5-syzkaller-gc32f8dc5aaf9 #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : bchfs_truncate+0x88c/0xa70 fs/bcachefs/fs-io.c:469 lr : bchfs_truncate+0x88c/0xa70 fs/bcachefs/fs-io.c:469 sp : ffff8000b1f076c0 x29: ffff8000b1f07950 x28: 0000000000100000 x27: ffff0000dde187c8 x26: ffff0000dde18c40 x25: ffff8000b1f07ad0 x24: ffff7000163e0ee8 x23: 000000000000000a x22: ffff0000dde18d00 x21: ffff0000dde18c38 x20: dfff800000000000 x19: ffff0000dde18798 x18: 00000000ffffffff x17: 0000000000000000 x16: ffff80008adb410c x15: 0000000000000001 x14: 1fffe0003386cee2 x13: 0000000000000000 x12: 0000000000000000 x11: ffff60003386cee3 x10: 0000000000ff0100 x9 : 62868bc9b47e5b00 x8 : 62868bc9b47e5b00 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff8000b1f07018 x4 : ffff80008f405b40 x3 : ffff8000807b1330 x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000 Call trace: bchfs_truncate+0x88c/0xa70 fs/bcachefs/fs-io.c:469 (P) bch2_setattr+0x198/0x20c fs/bcachefs/fs.c:1245 notify_change+0x9a4/0xc50 fs/attr.c:552 do_truncate+0x178/0x1f0 fs/open.c:65 vfs_truncate+0x398/0x444 fs/open.c:115 do_sys_truncate+0xe4/0x1a8 fs/open.c:138 __do_sys_truncate fs/open.c:150 [inline] __se_sys_truncate fs/open.c:148 [inline] __arm64_sys_truncate+0x5c/0x74 fs/open.c:148 __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: 146 hardirqs last enabled at (145): [] __up_console_sem kernel/printk/printk.c:344 [inline] hardirqs last enabled at (145): [] __console_unlock+0x70/0xc4 kernel/printk/printk.c:2885 hardirqs last disabled at (146): [] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:511 softirqs last enabled at (42): [] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32 softirqs last disabled at (40): [] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19 ---[ end trace 0000000000000000 ]---