nodejs / nodejs/node

`mkdir` with the `recursive` flag hides `EROFS` readonly file system errors with `ENOENT`

Open
#47,098 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

fs
Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

Description

Version

v19.7.0

Platform

Linux 0a51b4117477 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 Linux

Subsystem

fs

What steps will reproduce the bug?
  1. Clone https://github.com/Silic0nS0ldier/nodejs-mkdir-recursive-hides-erofs
  2. With repo root as cwd, run commands listed in README. Reported issue is first test case.
How often does it reproduce? Is there a required condition?

Provided the target of mkdir is a read only filesystem and the directory does not already exist, this issue reproduces 100% of the time.

What is the expected behavior? Why is that the expected behavior?

An error with the error code EROFS.

What do you see instead?

An error with the error code ENOENT.

Additional information

On AMD64 systems the digest will need to be re-acquired, as this reproduction was created on an ARM64 host.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the first test case from the linked reproduction repository's README on a Linux read-only filesystem, then trace Node.js's recursive mkdir path in the fs subsystem. Done means the same case reports EROFS rather than ENOENT; check the stated v19.7.0 scenario and AMD64 behavior as needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, linux, node.js
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.