------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 10 < 1048576 WARNING: CPU: 1 PID: 6296 at fs/bcachefs/fs-io.c:428 bchfs_truncate+0xbca/0xc90 fs/bcachefs/fs-io.c:425 Modules linked in: CPU: 1 UID: 0 PID: 6296 Comm: syz.2.27 Not tainted 6.12.0-syzkaller-09073-g9f16d5e6f220 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 RIP: 0010:bchfs_truncate+0xbca/0xc90 fs/bcachefs/fs-io.c:425 Code: fc ff df 41 80 3c 06 00 74 08 48 89 df e8 ae 48 d6 fd 48 8b 94 24 20 01 00 00 48 c7 c7 00 15 53 8c 4c 89 fe e8 87 0c 2c fd 90 <0f> 0b 90 90 e9 cf f9 ff ff e8 68 66 6b fd 48 8b 5c 24 60 48 89 df RSP: 0018:ffffc9000558f9c0 EFLAGS: 00010246 RAX: e8c6ffcb8c857100 RBX: ffffc9000558fae0 RCX: 0000000000080000 RDX: ffffc9000f0fb000 RSI: 0000000000006b04 RDI: 0000000000006b05 RBP: ffffc9000558fc38 R08: ffffffff815688b2 R09: fffffbfff1cfa8a0 R10: dffffc0000000000 R11: fffffbfff1cfa8a0 R12: 1ffff1100ebdd183 R13: ffff888075ee87d0 R14: 1ffff92000ab1f5c R15: 000000000000000a FS: 00007f4daa6dc6c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000110c2ef4b8 CR3: 00000000291fa000 CR4: 0000000000350ef0 Call Trace: notify_change+0xbcc/0xe90 fs/attr.c:552 do_truncate+0x220/0x310 fs/open.c:65 vfs_truncate+0x2e1/0x3b0 fs/open.c:111 do_sys_truncate+0xdb/0x190 fs/open.c:134 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4da997e819 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4daa6dc038 EFLAGS: 00000246 ORIG_RAX: 000000000000004c RAX: ffffffffffffffda RBX: 00007f4da9b36080 RCX: 00007f4da997e819 RDX: 0000000000000000 RSI: 0000000000007fff RDI: 0000000020000040 RBP: 00007f4da99f175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f4da9b36080 R15: 00007ffe4905cdb8