]> git.lizzy.rs Git - rust.git/commit
Workaround for copy_file_range spuriously returning EOPNOTSUPP when attemted on a...
authorThe8472 <git@infinite-source.de>
Tue, 11 Aug 2020 23:15:08 +0000 (01:15 +0200)
committerThe8472 <git@infinite-source.de>
Tue, 11 Aug 2020 23:30:22 +0000 (01:30 +0200)
commit1316c786a08344c965a97b1b67c76a300a479eec
treedeb30515edb9517b275a8bb600c79d46d05719f4
parente5e33ebd2ba12a78dbf6e2d5f154d5f71f28576c
Workaround for copy_file_range spuriously returning EOPNOTSUPP when attemted on a NFS mount under RHEL/CentOS 7.

The syscall is supposed to return ENOSYS in most cases but when calling it on NFS it may leak through
EOPNOTSUPP even though that's supposed to be handled by the kernel and not returned to userspace.
Since it returns ENOSYS in some cases anyway this will trip the  HAS_COPY_FILE_RANGE
detection anyway, so treat EOPNOTSUPP as if it were a ENOSYS.

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.8_release_notes/deprecated_functionality#the_literal_copy_file_range_literal_call_has_been_disabled_on_local_file_systems_and_in_nfs
https://bugzilla.redhat.com/show_bug.cgi?id=1783554
library/std/src/sys/unix/fs.rs