GlusterFS can set the errno to EBADFD for lseek SEEK_DATA.

Tested-by: Tomáš Mózes <hydrapo...@gmail.com>
Bug: https://bugs.gentoo.org/705536
Signed-off-by: Zac Medico <zmed...@gentoo.org>
---
 src/portage_util_file_copy_reflink_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/portage_util_file_copy_reflink_linux.c 
b/src/portage_util_file_copy_reflink_linux.c
index 352342c06..f3278aeb7 100644
--- a/src/portage_util_file_copy_reflink_linux.c
+++ b/src/portage_util_file_copy_reflink_linux.c
@@ -258,7 +258,7 @@ _reflink_linux_file_copy(PyObject *self, PyObject *args)
                     break;
                 } else if (len < 0) {
                     error = errno;
-                    if ((errno == EINVAL || errno == EOPNOTSUPP) && 
!offset_out) {
+                    if ((errno == EINVAL || errno == EOPNOTSUPP || errno == 
EBADFD) && !offset_out) {
                         lseek_works = 0;
                     }
                     break;
-- 
2.24.1


Reply via email to