GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fs: harden the one-round-trip read and write jobs by 3zrv · Pull Request #67112 · nodejs/node

Conversation

@3zrv

@3zrv 3zrv commented Oct 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Follow-up to fs: read small files in one thread pool round trip.

  • ReadFileJob and WriteFileJob now run the permission check on the path stored at construction, not the value passed to run(), so the check cannot differ from the path the thread pool opens. run() nolonger takes an argument.
  • ReadFileJob grew the native buffer of a size-0 file (/dev/zero, pipes, procfs) until EOF or OOM. It now stops at 2 GiB (kIoMaxLength) and hands the fd back with a size over the limit, so both callers reject with ERR_FS_FILE_TOO_LARGE and close it, as for a regular file of that size. The previous chunked reader was equally unbounded, so this is hardening, not a regression fix.

Tests: test-permission-fs-one-round-trip-path.js. The cap has no test because it would have to read 2 GiB.

Disclosure: this PR was assisted by Sonnet 5.5.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Mohamed Sayed
fs: harden the one-round-trip read and write jobs
36b15ed
Signed-off-by: Mohamed Sayed <[email protected]>
@nodejs-github-bot

nodejs-github-bot commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/security-wg
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels Oct 29, 2026
@codecov

codecov Bot commented Oct 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.66667% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.68%. Comparing base (5f602d5) to head (0f6326d).

Files with missing lines Patch % Lines
src/node_file.cc 27.27% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67112      +/-   ##
==========================================
- Coverage   90.68%   90.68%   -0.01%     
==========================================
  Files         797      797              
  Lines      279574   279575       +1     
  Branches    53778    53775       -3     
==========================================
  Hits       253525   253525              
- Misses      16344    16347       +3     
+ Partials     9705     9703       -2     
Files with missing lines Coverage Δ
lib/fs.js 97.17% <100.00%> (ø)
lib/internal/fs/promises.js 91.22% <100.00%> (ø)
src/node_file.cc 76.06% <27.27%> (-0.16%) ⬇️

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Nov 7, 2026
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 7, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 7, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78896/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Mohamed Sayed
Merge remote-tracking branch 'origin/main' into fs-harden-one-round-t…
0f6326d
…rip-jobs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@3zrv @nodejs-github-bot @mcollina
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.