------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 8 < 1048576 WARNING: CPU: 1 PID: 7986 at fs/bcachefs/fs-io.c:457 bchfs_truncate+0x998/0xa88 fs/bcachefs/fs-io.c:454 Modules linked in: CPU: 1 UID: 0 PID: 7986 Comm: syz.2.272 Not tainted 6.14.0-rc5-syzkaller-g77c95b8c7a16 #0 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+0x998/0xa88 fs/bcachefs/fs-io.c:454 lr : bchfs_truncate+0x998/0xa88 fs/bcachefs/fs-io.c:454 sp : ffff80009df67740 x29: ffff80009df67960 x28: ffff700013becefc x27: ffff0000f177a308 x26: 0000000000100000 x25: 1fffe0001e2ef479 x24: dfff800000000000 x23: ffff0000f177a300 x22: ffff0000f177a3c8 x21: 0000000000000008 x20: ffff800092f0a000 x19: ffff0000f1779e60 x18: 1fffe000366f6086 x17: ffff80008fbbd000 x16: ffff8000804696fc x15: 0000000000000001 x14: 1fffe000366f8af0 x13: ffff80009df68000 x12: 0000000000000003 x11: 0000000000000001 x10: 0000000000000003 x9 : d9fcbdddd5cf0000 x8 : d9fcbdddd5cf0000 x7 : ffff8000803d4bfc x6 : 0000000000000000 x5 : 0000000000000001 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 0000000000000006 x1 : ffff80008b87a5a0 x0 : ffff800123ca8000 Call trace: bchfs_truncate+0x998/0xa88 fs/bcachefs/fs-io.c:454 (P) bch2_setattr+0x1a0/0x214 fs/bcachefs/fs.c:1199 notify_change+0x9f0/0xca0 fs/attr.c:552 do_truncate+0x1c0/0x28c fs/open.c:65 vfs_truncate+0x3fc/0x464 fs/open.c:115 do_sys_truncate+0xe8/0x1ac fs/open.c:138 __do_sys_truncate fs/open.c:150 [inline] __se_sys_truncate fs/open.c:148 [inline] __arm64_sys_truncate+0x5c/0x70 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+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: 168 hardirqs last enabled at (167): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1533 [inline] hardirqs last enabled at (167): [] finish_lock_switch+0xbc/0x1e4 kernel/sched/core.c:5132 hardirqs last disabled at (168): [] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:488 softirqs last enabled at (160): [] softirq_handle_end kernel/softirq.c:407 [inline] softirqs last enabled at (160): [] handle_softirqs+0xb44/0xd34 kernel/softirq.c:589 softirqs last disabled at (147): [] __do_softirq+0x14/0x20 kernel/softirq.c:595 ---[ end trace 0000000000000000 ]---