------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 10 < 12288 WARNING: CPU: 0 PID: 5338 at fs/bcachefs/fs-io.c:474 bchfs_truncate+0xa3b/0xc20 fs/bcachefs/fs-io.c:471 Modules linked in: CPU: 0 UID: 0 PID: 5338 Comm: syz.0.0 Not tainted 6.16.0-rc4-syzkaller-00013-g66701750d556 #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:bchfs_truncate+0xa3b/0xc20 fs/bcachefs/fs-io.c:471 Code: 00 74 0a 48 8b 7c 24 20 e8 f2 25 e9 fd 4c 8b 7c 24 20 49 8b 37 48 8b 94 24 00 01 00 00 48 c7 c7 00 b4 d4 8b e8 96 4b 49 fd 90 <0f> 0b 90 90 e9 95 fa ff ff e8 f7 a2 85 fd 4c 8b 7c 24 50 4c 89 ff RSP: 0018:ffffc9000f74f540 EFLAGS: 00010246 RAX: 86238a429f400700 RBX: 1ffff1100a894188 RCX: ffff888000fcc880 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000002 RBP: ffffc9000f74f7d0 R08: 0000000000000003 R09: 0000000000000004 R10: dffffc0000000000 R11: fffffbfff1bfa9fc R12: ffff8880544a0c40 R13: ffff8880544a0d00 R14: 000000000000000a R15: ffff8880544a07e8 FS: 00007fab9f3f56c0(0000) GS:ffff88808d250000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000000122e5000 CR4: 0000000000352ef0 Call Trace: notify_change+0xb33/0xe40 fs/attr.c:552 do_truncate+0x1a4/0x220 fs/open.c:68 handle_truncate fs/namei.c:3517 [inline] do_open fs/namei.c:3900 [inline] path_openat+0x306c/0x3830 fs/namei.c:4055 do_filp_open+0x1fa/0x410 fs/namei.c:4082 do_sys_openat2+0x121/0x1c0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1463 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:0x7faba2f8e929 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:00007fab9f3f5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007faba31b6160 RCX: 00007faba2f8e929 RDX: 0000000000020200 RSI: 0000200000000080 RDI: ffffffffffffff9c RBP: 00007faba3010b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007faba31b6160 R15: 00007ffd24879f78