------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 10 < 1048576 WARNING: CPU: 1 PID: 7048 at fs/bcachefs/fs-io.c:428 bchfs_truncate+0x998/0xa88 fs/bcachefs/fs-io.c:425 Modules linked in: CPU: 1 UID: 0 PID: 7048 Comm: syz.3.105 Not tainted 6.12.0-syzkaller-g7b1d1d4cfac0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : bchfs_truncate+0x998/0xa88 fs/bcachefs/fs-io.c:425 lr : bchfs_truncate+0x998/0xa88 fs/bcachefs/fs-io.c:425 sp : ffff8000a38c77a0 x29: ffff8000a38c79c0 x28: ffff0000f8100000 x27: ffff0000f7d81390 x26: ffff0000f7d81398 x25: dfff800000000000 x24: ffff700014718f08 x23: 0000000000100000 x22: ffff0000f7d81458 x21: 000000000000000a x20: ffff800092ab5000 x19: ffff0000f7d80f00 x18: 0000000000000008 x17: 0000000000000000 x16: ffff8000830d1d70 x15: 0000000000000001 x14: 1fffe000366cb0e2 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000002 x10: 0000000000ff0100 x9 : 9a33f437707d5d00 x8 : 9a33f437707d5d00 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff8000a38c6ed8 x4 : ffff80008f90d220 x3 : ffff800080626d8c x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000 Call trace: bchfs_truncate+0x998/0xa88 fs/bcachefs/fs-io.c:425 (P) bchfs_truncate+0x998/0xa88 fs/bcachefs/fs-io.c:425 (L) bch2_setattr+0x1a0/0x214 fs/bcachefs/fs.c:1163 notify_change+0x9f0/0xca0 fs/attr.c:503 do_truncate+0x1c0/0x28c fs/open.c:65 vfs_truncate+0x2b8/0x360 fs/open.c:111 do_sys_truncate+0xe8/0x1ac fs/open.c:134 __do_sys_truncate fs/open.c:146 [inline] __se_sys_truncate fs/open.c:144 [inline] __arm64_sys_truncate+0x5c/0x70 fs/open.c:144 __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+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 irq event stamp: 404 hardirqs last enabled at (403): [] __up_console_sem kernel/printk/printk.c:344 [inline] hardirqs last enabled at (403): [] __console_unlock+0x70/0xc4 kernel/printk/printk.c:2844 hardirqs last disabled at (404): [] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:488 softirqs last enabled at (124): [] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32 softirqs last disabled at (120): [] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19 ---[ end trace 0000000000000000 ]---