------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 10 < 12288 WARNING: CPU: 0 PID: 5350 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: 5350 Comm: syz.0.0 Not tainted 6.16.0-rc7-syzkaller #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 02 ed e8 fd 4c 8b 7c 24 20 49 8b 37 48 8b 94 24 00 01 00 00 48 c7 c7 80 c3 d4 8b e8 86 51 49 fd 90 <0f> 0b 90 90 e9 95 fa ff ff e8 37 6c 85 fd 4c 8b 7c 24 50 4c 89 ff RSP: 0018:ffffc9000d2cf540 EFLAGS: 00010246 RAX: 018bf7dca1637500 RBX: 1ffff110024f5188 RCX: ffff888033864880 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000002 RBP: ffffc9000d2cf7d0 R08: 0000000000000003 R09: 0000000000000004 R10: dffffc0000000000 R11: fffffbfff1bfaa6c R12: ffff8880127a8c40 R13: ffff8880127a8d00 R14: 000000000000000a R15: ffff8880127a87e8 FS: 00007feae933e6c0(0000) GS:ffff88808d218000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffe3c9e4f58 CR3: 0000000052bf9000 CR4: 0000000000352ef0 Call Trace: notify_change+0xb36/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_creat fs/open.c:1530 [inline] __se_sys_creat fs/open.c:1524 [inline] __x64_sys_creat+0x8f/0xc0 fs/open.c:1524 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:0x7feae858e9a9 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:00007feae933e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007feae87b6080 RCX: 00007feae858e9a9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000080 RBP: 00007feae8610d69 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007feae87b6080 R15: 00007ffe3c9e5bb8