Fixes several bugs in AllocateFileRange.
Not a real fix for #33128, but a workaround for the issue.
Potentially might fix #28552 too, but I don’t have a way to reproduce that. (After digging into Apple’s XNU code, it looks too buggy to try to use F_PREALLOCATE
at all IMO; for reference: XNU kernel code and HFS driver code - notice the truncation risk from comparing to block-allocated size rather than file size and reachable code paths the comments assume to be dead code)