Repository navigation
(6/8) fix(files): check upload space on the target mount and harden trash exclude append - #142
Merged
Merged
Conversation
…xclude append Upload start() measured only the destination filesystem while staging files land in parents that may sit on another mount, over-promising the shared reserve and failing late per chunk. Check each item's resolved parent, the same filesystem per-chunk writes measure. Workspace-Trash appended to .git/info/exclude check-then-act through a symlink. Read and append through one O_NOFOLLOW descriptor and verify isFile() on the open fd, mirroring text.mjs openRegular.
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.
Upload start() measured free space only on the destination, so an upload aimed into a nearly-full mounted subdir passed the pre-check, poisoned the shared process-global reserve, and then failed late per chunk after partially filling the mount. start() now checks each item's resolved parent filesystem, the same one per-chunk writes measure. Uploads onto mounts stay supported. Separately, workspace Trash appended to .git/info/exclude check-then-act through a symlink; it now reads and appends through a single O_NOFOLLOW descriptor with an isFile() check on the open fd, mirroring text.mjs.
Validation: uploads and trash suites pass (15/15 on current main, including the new mount-constrained and exclude-link regression tests); the new upload test fails on the old code, confirming it catches the bug. Related files, git, and text suites pass; node --check clean.