Skip to content

Commit 03345ab

Browse files
kennyhyunhiimjako
andcommitted
src: handle EROFS in mkdir recursive
Add UV_EROFS to the list of errors that should be returned immediately in MKDirpSync and MKDirpAsync, preventing it from being incorrectly converted to ENOENT when mkdir is called with the recursive option on a read-only filesystem. Based on the original fix by Alberto Moretti (@hiimjako) in #48105. Refs: #47098 Refs: #48105 Co-authored-by: Alberto Moretti <moretti919@gmail.com> Signed-off-by: Kenny Yeo <kenny@yeoyou.net>
1 parent fd983b7 commit 03345ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/node_file.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,6 +1874,7 @@ int MKDirpSync(uv_loop_t* loop,
18741874
case UV_EACCES:
18751875
case UV_ENOSPC:
18761876
case UV_ENOTDIR:
1877+
case UV_EROFS:
18771878
case UV_EPERM: {
18781879
return err;
18791880
}
@@ -1954,6 +1955,7 @@ int MKDirpAsync(
19541955
case UV_EACCES:
19551956
case UV_ENOSPC:
19561957
case UV_ENOTDIR:
1958+
case UV_EROFS:
19571959
case UV_EPERM: {
19581960
req_wrap->continuation_data()->Done(err);
19591961
break;

0 commit comments

Comments
 (0)