Skip to content

Commit

Permalink
unix: check for EXDEV in uv__fs_sendfile()
Browse files Browse the repository at this point in the history
copy_file_range will not work when in_fd and out_fd
are not on the same mounted filesystem (pre Linux 5.3).

Refs: nodejs/node#37284
PR-URL: libuv#3108
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
RaisinTen authored and JeffroMF committed May 16, 2022
1 parent 3423e9c commit 6b2978b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/unix/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,10 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) {
/* ENOSYS - it will never work */
errno = 0;
copy_file_range_support = 0;
} else if (r == -1 && errno == ENOTSUP) {
} else if (r == -1 && (errno == ENOTSUP || errno == EXDEV)) {
/* ENOTSUP - it could work on another file system type */
/* EXDEV - it will not work when in_fd and out_fd are not on the same
mounted filesystem (pre Linux 5.3) */
errno = 0;
} else {
goto ok;
Expand Down

0 comments on commit 6b2978b

Please sign in to comment.