fix(vfs/posix): various vfs fixes for Linux#4039
Open
AvarianKnight wants to merge 1 commit into
Open
Conversation
13c2493 to
986cd7e
Compare
FabianTerhorst
suggested changes
Jun 18, 2026
Contributor
Author
|
Question, for the |
986cd7e to
c97e90a
Compare
Contributor
Author
|
Other issues here have been fixed. I will build this later today to double check that everything works. |
39b6139 to
25ef03a
Compare
While trying to find what could possibly cause files on disk to become corrupted on Linux I started going through the VFS implementation for Linux and noticed a few issues. This fixes a few issues here: Read/ReadBulk/Write don't try to loop until all of their bytes are written RenameFile returns `0` on success, while we were checking if it was successful by checking if it was `!= 0` GetLength was still reading the buf even though there isn't valid data in it. Fixes a bug where in certain cases where readdir would return `NULL` we never released the `DIR` file handle See: https://man7.org/linux/man-pages/man2/write.2.html https://man7.org/linux/man-pages/man2/read.2.html https://man7.org/linux/man-pages/man2/pread.2.html https://man7.org/linux/man-pages/man3/fstat.3p.html https://man7.org/linux/man-pages/man2/rename.2.html https://man7.org/linux/man-pages/man3/readdir.3.html
25ef03a to
9f70708
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While trying to find what could possibly cause files on disk to become corrupted on Linux I started going through the VFS implementation for Linux and noticed a few issues.
This fixes a few issues here:
Read/ReadBulk/Write don't try to loop until all of their bytes are written
RenameFile returns
0on success, while we were checking if it was successful by checking if it was!= 0GetLength was still reading the buf even though there isn't valid data in it.
See:
https://man7.org/linux/man-pages/man2/write.2.html https://man7.org/linux/man-pages/man2/read.2.html
https://man7.org/linux/man-pages/man2/pread.2.html https://man7.org/linux/man-pages/man3/fstat.3p.html https://man7.org/linux/man-pages/man2/rename.2.html
This PR applies to the following area(s)
Server
Successfully tested on
Game builds: ..
Platforms: Linux
Checklist