Skip to content

Commit 4ec3664

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: [ci skip] NEWS Fix GH-10548: copy() fails on cifs mounts because of incorrect length (cfr_max) specified in streams.c:1584 copy_file_range() (#10551)
2 parents a11e9c9 + 4d0ce3a commit 4ec3664

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main/streams/streams.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,13 @@ PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *de
16151615
/* not implemented by this Linux kernel */
16161616
break;
16171617

1618+
case EIO:
1619+
/* Some filesystems will cause failures if the max length is greater than the file length
1620+
* in certain circumstances and configuration. In those cases the errno is EIO and we will
1621+
* fall back to other methods. We cannot use stat to determine the file length upfront because
1622+
* that is prone to races and outdated caching. */
1623+
break;
1624+
16181625
default:
16191626
/* unexpected I/O error - give up, no fallback */
16201627
*len = haveread;

0 commit comments

Comments
 (0)