------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 65007 < 1048576 WARNING: fs/bcachefs/fs-io.c:472 at bchfs_truncate+0xa4a/0xc50 fs/bcachefs/fs-io.c:469, CPU#1: syz.7.3563/20861 Modules linked in: CPU: 1 UID: 0 PID: 20861 Comm: syz.7.3563 Not tainted 6.16.0-rc6-next-20250718-syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 RIP: 0010:bchfs_truncate+0xa4a/0xc50 fs/bcachefs/fs-io.c:469 Code: 00 74 0a 48 8b 7c 24 18 e8 e3 27 e4 fd 4c 8b 7c 24 18 49 8b 37 48 8b 94 24 50 01 00 00 48 c7 c7 40 09 d5 8b e8 47 5f 44 fd 90 <0f> 0b 90 90 4c 89 f3 e9 a0 fa ff ff e8 a5 d7 80 fd 4c 8b 7c 24 58 RSP: 0018:ffffc900048a74a0 EFLAGS: 00010246 RAX: b7df87713f40f500 RBX: dffffc0000000000 RCX: 0000000000080000 RDX: ffffc9000d9a2000 RSI: 00000000000049b4 RDI: 00000000000049b5 RBP: ffffc900048a7790 R08: 0000000000000003 R09: 0000000000000004 R10: dffffc0000000000 R11: fffffbfff1bfa7f0 R12: ffff8880579caaa0 R13: 1ffff92000914ea8 R14: dffffc0000000000 R15: ffff8880579ca648 FS: 00007f6db1e7e6c0(0000) GS:ffff888125ce3000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6614ade000 CR3: 000000004a39a000 CR4: 00000000003526f0 Call Trace: bch2_setattr+0x195/0x230 fs/bcachefs/fs.c:1215 notify_change+0xb33/0xe40 fs/attr.c:552 do_truncate+0x1a4/0x220 fs/open.c:68 handle_truncate fs/namei.c:3508 [inline] do_open fs/namei.c:3891 [inline] path_openat+0x306c/0x3830 fs/namei.c:4046 do_filp_open+0x1fa/0x410 fs/namei.c:4073 do_sys_openat2+0x121/0x1c0 fs/open.c:1435 do_sys_open fs/open.c:1450 [inline] __do_sys_openat fs/open.c:1466 [inline] __se_sys_openat fs/open.c:1461 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1461 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6db0f8e9a9 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:00007f6db1e7e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f6db11b6160 RCX: 00007f6db0f8e9a9 RDX: 0000000000123380 RSI: 00002000000001c0 RDI: ffffffffffffff9c RBP: 00007f6db1010d69 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000000d4 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f6db11b6160 R15: 00007ffe63cf4ca8