------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 10 < 12288 WARNING: CPU: 0 PID: 5364 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: 5364 Comm: syz.0.0 Not tainted 6.16.0-rc7-syzkaller-00127-g302f88ff3584 #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 a2 eb e8 fd 4c 8b 7c 24 20 49 8b 37 48 8b 94 24 00 01 00 00 48 c7 c7 40 c4 d4 8b e8 16 50 49 fd 90 <0f> 0b 90 90 e9 95 fa ff ff e8 d7 6a 85 fd 4c 8b 7c 24 50 4c 89 ff RSP: 0018:ffffc9000f54f540 EFLAGS: 00010246 RAX: 30e788035be21f00 RBX: 1ffff110087f3188 RCX: ffff888011ad2440 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000002 RBP: ffffc9000f54f7d0 R08: 0000000000000003 R09: 0000000000000004 R10: dffffc0000000000 R11: fffffbfff1bfaa6c R12: ffff888043f98c40 R13: ffff888043f98d00 R14: 000000000000000a R15: ffff888043f987e8 FS: 00007f5c5f17e6c0(0000) GS:ffff88808d218000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffcae666dc0 CR3: 00000000122a3000 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_open fs/open.c:1460 [inline] __se_sys_open fs/open.c:1456 [inline] __x64_sys_open+0x11e/0x150 fs/open.c:1456 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:0x7f5c5e38e9a9 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:00007f5c5f17e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f5c5e5b6160 RCX: 00007f5c5e38e9a9 RDX: 0000000000000020 RSI: 000000000014927e RDI: 00002000000001c0 RBP: 00007f5c5e410d69 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f5c5e5b6160 R15: 00007ffcae6675a8