cp: Revert "If copy_file_range(2) fails with EXDEV, use fall-back."

This reverts commit 6433365490.

The error is not valid per api contract, it showed up as a regression
after 15f0b8c309

15f0b8c309 ("zfs: merge openzfs/zfs@9cd71c860 (master)") and was
subsequently in d012836fb6 ("zfs: fix up EXDEV handling for
clone_range").

Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Mateusz Guzik
2023-04-24 16:04:53 +00:00
parent 9b02f2daf4
commit c5b5f2d808
+1 -1
View File
@@ -180,7 +180,7 @@ copy_file(const FTSENT *entp, int dne)
if (use_copy_file_range) { if (use_copy_file_range) {
wcount = copy_file_range(from_fd, NULL, wcount = copy_file_range(from_fd, NULL,
to_fd, NULL, SSIZE_MAX, 0); to_fd, NULL, SSIZE_MAX, 0);
if (wcount < 0 && (errno == EINVAL || errno == EXDEV)) { if (wcount < 0 && errno == EINVAL) {
/* Prob a non-seekable FD */ /* Prob a non-seekable FD */
use_copy_file_range = 0; use_copy_file_range = 0;
} }