------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 10 < 1048576 WARNING: CPU: 1 PID: 7741 at fs/bcachefs/fs-io.c:472 bchfs_truncate+0x88c/0xa70 fs/bcachefs/fs-io.c:469 Modules linked in: CPU: 1 UID: 0 PID: 7741 Comm: syz.0.186 Not tainted 6.15.0-rc7-syzkaller-gd7fa1af5b33e #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 : ffff80009dac76c0 x29: ffff80009dac7950 x28: 0000000000100000 x27: ffff0000f8fd3558 x26: ffff0000f8fd39d0 x25: ffff80009dac7ad0 x24: ffff700013b58ee8 x23: 000000000000000a x22: ffff0000f8fd3a90 x21: ffff0000f8fd39c8 x20: dfff800000000000 x19: ffff0000f8fd3528 x18: 1fffe0003386f276 x17: ffff80008f31e000 x16: ffff80008adbe9e4 x15: 0000000000000001 x14: 1fffe000184db880 x13: 0000000000000000 x12: 0000000000000000 x11: ffff6000184db881 x10: 0000000000000003 x9 : 479cfd19a645f900 x8 : 479cfd19a645f900 x7 : ffff800080485878 x6 : 0000000000000000 x5 : 0000000000000001 x4 : 0000000000000001 x3 : ffff80008047843c x2 : 0000000000000001 x1 : ffff80008b3ebc40 x0 : 0000000000000001 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: 178 hardirqs last enabled at (177): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1525 [inline] hardirqs last enabled at (177): [] finish_lock_switch+0xb0/0x1c0 kernel/sched/core.c:5130 hardirqs last disabled at (178): [] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:511 softirqs last enabled at (160): [] softirq_handle_end kernel/softirq.c:425 [inline] softirqs last enabled at (160): [] handle_softirqs+0xaf8/0xc88 kernel/softirq.c:607 softirqs last disabled at (125): [] __do_softirq+0x14/0x20 kernel/softirq.c:613 ---[ end trace 0000000000000000 ]--- bcachefs (loop0): bucket 0:34 gen 0 data type user sector count overflow: 0 + -8 > U32_MAX while marking u64s 7 type extent 536870912:589848:U32_MAX len 24 ver 0: durability: 1 crc: c_size 8 size 24 offset 0 nonce 0 csum none 0:0 compress lz4 ptr: 0:34:8 gen 0