------------[ cut here ]------------ truncate spotted in mem i_size < btree i_size: 1 < 1048576 WARNING: CPU: 1 PID: 6838 at fs/bcachefs/fs-io.c:454 bchfs_truncate+0x808/0xd80 fs/bcachefs/fs-io.c:454 Modules linked in: CPU: 1 UID: 0 PID: 6838 Comm: syz.2.207 Not tainted 6.14.0-syzkaller-03576-g1e1ba8d23dae #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 RIP: 0010:bchfs_truncate+0x808/0xd80 fs/bcachefs/fs-io.c:454 Code: 24 48 84 c0 0f 85 85 fc ff ff e8 43 f2 7a fd c6 05 12 ea 0a 0c 01 90 48 c7 c7 80 f7 c2 8b 4c 89 f2 4c 89 ee e8 29 9d 3a fd 90 <0f> 0b 90 90 48 b8 00 00 00 00 00 fc ff df 48 8b 54 24 40 48 c1 ea RSP: 0018:ffffc900031e7718 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff888053558000 RCX: ffffc900106e1000 RDX: 0000000000080000 RSI: ffffffff817aae25 RDI: 0000000000000001 RBP: ffffc900031e7920 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffffc900031e7a18 R13: 0000000000000001 R14: 0000000000100000 R15: ffff888053558568 FS: 00007feaafb5f6c0(0000) GS:ffff888124f5a000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000110c2695b3 CR3: 00000000333d8000 CR4: 0000000000350ef0 Call Trace: bch2_setattr+0x19c/0x240 fs/bcachefs/fs.c:1199 notify_change+0x6a9/0x1230 fs/attr.c:552 do_truncate+0x15b/0x220 fs/open.c:65 handle_truncate fs/namei.c:3466 [inline] do_open fs/namei.c:3849 [inline] path_openat+0x2761/0x2d40 fs/namei.c:4004 do_filp_open+0x20b/0x470 fs/namei.c:4031 do_sys_openat2+0x11b/0x1d0 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_creat fs/open.c:1522 [inline] __se_sys_creat fs/open.c:1516 [inline] __x64_sys_creat+0xcc/0x120 fs/open.c:1516 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7feaaed8d169 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:00007feaafb5f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007feaaefa6160 RCX: 00007feaaed8d169 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00002000000003c0 RBP: 00007feaaee0e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007feaaefa6160 R15: 00007ffe62f46df8