Kernel bug: kernel BUG in new_curseg (2)
Subsystem: f2fs
Status: fixed

Crash report:
------------[ cut here ]------------
kernel BUG at fs/f2fs/segment.c:2809!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 UID: 0 PID: 5823 Comm: syz-executor115 Not tainted 6.14.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
RIP: 0010:get_new_segment fs/f2fs/segment.c:2809 [inline]
RIP: 0010:new_curseg+0x1f52/0x1f70 fs/f2fs/segment.c:2939
Code: fb fd e9 1a fa ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 4c fa ff ff 48 89 df e8 99 52 fb fd e9 3f fa ff ff e8 df 40 97 fd 90 <0f> 0b e8 d7 40 97 fd 90 0f 0b e8 cf 40 97 fd 90 0f 0b e8 c7 40 97
RSP: 0018:ffffc9000406f4a8 EFLAGS: 00010293
RAX: ffffffff84280e61 RBX: 0000000000000018 RCX: ffff88807bb40000
RDX: 0000000000000000 RSI: 0000000000000018 RDI: 0000000000000018
RBP: dffffc0000000000 R08: ffffffff8427fc95 R09: fffff5200080de84
R10: dffffc0000000000 R11: fffff5200080de84 R12: 0000000000000018
R13: ffff88807c4a1101 R14: 0000000000000018 R15: ffff88807bb3a9d8
FS:  000055555a87e380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd25f2d8100 CR3: 0000000029f36000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __allocate_new_segment+0x1ce/0x940 fs/f2fs/segment.c:3273
 f2fs_allocate_new_section fs/f2fs/segment.c:3287 [inline]
 f2fs_allocate_pinning_section+0xfa/0x4e0 fs/f2fs/segment.c:3301
 f2fs_expand_inode_data+0x696/0xca0 fs/f2fs/file.c:1849
 f2fs_fallocate+0x537/0xa10 fs/f2fs/file.c:1959
 vfs_fallocate+0x623/0x7a0 fs/open.c:338
 do_vfs_ioctl+0x258c/0x2e40 fs/ioctl.c:885
 __do_sys_ioctl fs/ioctl.c:904 [inline]
 __se_sys_ioctl+0x80/0x170 fs/ioctl.c:892
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fd25f25bcd9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe332ac848 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000400000000080 RCX: 00007fd25f25bcd9
RDX: 00004000000000c0 RSI: 0000000040305828 RDI: 0000000000000005
RBP: 00004000000000c0 R08: 000055555a87f4c0 R09: 000055555a87f4c0
R10: 0000000000000000 R11: 0000000000000246 R12: 00004000000000e0
R13: 0030656c69662f2e R14: 00004000000000c2 R15: 00007fd25f2a403b
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:get_new_segment fs/f2fs/segment.c:2809 [inline]
RIP: 0010:new_curseg+0x1f52/0x1f70 fs/f2fs/segment.c:2939
Code: fb fd e9 1a fa ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 4c fa ff ff 48 89 df e8 99 52 fb fd e9 3f fa ff ff e8 df 40 97 fd 90 <0f> 0b e8 d7 40 97 fd 90 0f 0b e8 cf 40 97 fd 90 0f 0b e8 c7 40 97
RSP: 0018:ffffc9000406f4a8 EFLAGS: 00010293
RAX: ffffffff84280e61 RBX: 0000000000000018 RCX: ffff88807bb40000
RDX: 0000000000000000 RSI: 0000000000000018 RDI: 0000000000000018
RBP: dffffc0000000000 R08: ffffffff8427fc95 R09: fffff5200080de84
R10: dffffc0000000000 R11: fffff5200080de84 R12: 0000000000000018
R13: ffff88807c4a1101 R14: 0000000000000018 R15: ffff88807bb3a9d8
FS:  000055555a87e380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd25f2d8100 CR3: 0000000029f36000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400