[PATCH] file_copy: handle lseek SEEK_DATA EBADFD for GlusterFS (bug 705536)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] file_copy: handle lseek SEEK_DATA EBADFD for GlusterFS (bug 705536)

Zac Medico-2
GlusterFS can set the errno to EBADFD for lseek SEEK_DATA.

Tested-by: Tomáš Mózes <[hidden email]>
Bug: https://bugs.gentoo.org/705536
Signed-off-by: Zac Medico <[hidden email]>
---
 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