New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unix: check for EXDEV for uv__fs_copy_file_range #3108
Conversation
copy_file_range will not work when in_fd and out_fd are not on the same mounted filesystem (pre Linux 5.3). Fixes: nodejs/node#37284 Refs: https://www.man7.org/linux/man-pages/man2/copy_file_range.2.html#ERRORS
src/unix/fs.c
Outdated
@@ -929,6 +929,11 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) { | |||
} else if (r == -1 && errno == ENOTSUP) { | |||
/* ENOTSUP - it could work on another file system type */ | |||
errno = 0; | |||
} else if (r == -1 && errno == EXDEV) { |
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.
I think you can combine this with the previous else if
:
} else if (r == -1 && (errno == ENOTSUP || errno == EXDEV)) {
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.
@cjihrig I combined the checks. PTAL.
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. CI seems fine as well: https://ci.nodejs.org/view/libuv/job/libuv-test-commit/2126/
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: #3108 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
Landed in 70f67d8. Thanks! |
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 <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
copy_file_range
will not work whenin_fd
andout_fd
are not on the same mounted filesystem (pre Linux 5.3).
Fixes: nodejs/node#37284
Refs: https://www.man7.org/linux/man-pages/man2/copy_file_range.2.html#ERRORS