1 |
EXT4 can set the errno to EUCLEAN for copy_file_range. |
2 |
|
3 |
Bug: https://bugs.gentoo.org/674332 |
4 |
Signed-off-by: Zac Medico <zmedico@g.o> |
5 |
--- |
6 |
[PATCH v2] Use #ifdef EUCLEAN as suggested by Michał Górny |
7 |
|
8 |
src/portage_util_file_copy_reflink_linux.c | 11 +++++++++-- |
9 |
1 file changed, 9 insertions(+), 2 deletions(-) |
10 |
|
11 |
diff --git a/src/portage_util_file_copy_reflink_linux.c b/src/portage_util_file_copy_reflink_linux.c |
12 |
index 352342c06..06361deb9 100644 |
13 |
--- a/src/portage_util_file_copy_reflink_linux.c |
14 |
+++ b/src/portage_util_file_copy_reflink_linux.c |
15 |
@@ -271,8 +271,15 @@ _reflink_linux_file_copy(PyObject *self, PyObject *args) |
16 |
|
17 |
if (copyfunc_ret < 0) { |
18 |
error = errno; |
19 |
- if ((errno == EXDEV || errno == ENOSYS || errno == EOPNOTSUPP) && |
20 |
- copyfunc == cfr_wrapper) { |
21 |
+ if (( |
22 |
+ errno == EXDEV |
23 |
+ || errno == ENOSYS |
24 |
+ || errno == EOPNOTSUPP |
25 |
+#ifdef EUCLEAN |
26 |
+ || errno == EUCLEAN |
27 |
+#endif |
28 |
+ ) |
29 |
+ && copyfunc == cfr_wrapper) { |
30 |
/* Use sendfile instead of copy_file_range for |
31 |
* cross-device copies, or when the copy_file_range |
32 |
* syscall is not available (less than Linux 4.5). |
33 |
-- |
34 |
2.18.1 |