Skip to content

Fix GH-10548: copy() fails on cifs mounts because of incorrect length (cfr_max) specified in streams.c:1584 copy_file_range() #10551

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

Merged
merged 1 commit into from
Feb 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions main/streams/streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,13 @@ PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *de
/* not implemented by this Linux kernel */
break;

case EIO:
/* Some filesystems will cause failures if the max length is greater than the file length
* in certain circumstances and configuration. In those cases the errno is EIO and we will
* fall back to other methods. We cannot use stat to determine the file length upfront because
* that is prone to races and outdated caching. */
break;

default:
/* unexpected I/O error - give up, no fallback */
*len = haveread;
Expand Down