1 |
On 1/2/19 8:55 PM, Michał Górny wrote: |
2 |
> On Wed, 2019-01-02 at 14:29 -0800, Zac Medico wrote: |
3 |
>> EXT4 can set the errno to EUCLEAN for copy_file_range. |
4 |
>> |
5 |
>> Bug: https://bugs.gentoo.org/674332 |
6 |
>> Signed-off-by: Zac Medico <zmedico@g.o> |
7 |
>> --- |
8 |
>> src/portage_util_file_copy_reflink_linux.c | 2 +- |
9 |
>> 1 file changed, 1 insertion(+), 1 deletion(-) |
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..1422232a5 100644 |
13 |
>> --- a/src/portage_util_file_copy_reflink_linux.c |
14 |
>> +++ b/src/portage_util_file_copy_reflink_linux.c |
15 |
>> @@ -271,7 +271,7 @@ _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 |
>> + if ((errno == EXDEV || errno == ENOSYS || errno == EOPNOTSUPP || errno == EUCLEAN) && |
21 |
>> copyfunc == cfr_wrapper) { |
22 |
>> /* Use sendfile instead of copy_file_range for |
23 |
>> * cross-device copies, or when the copy_file_range |
24 |
> |
25 |
> I'm pretty sure EUCLEAN is not portable to non-glibc/Linux systems. |
26 |
> |
27 |
|
28 |
Good catch, added #ifdef EUCLEAN in v2. |
29 |
-- |
30 |
Thanks, |
31 |
Zac |