[libglnx: 1/2] Fall back if copy_file_range fails with EINVAL




commit 24231a956a4b849087fbf01173cdebb53e1bd60b
Author: Olaf Leidinger <oleid mescharet de>
Date:   Mon Jan 24 16:12:57 2022 +0100

    Fall back if copy_file_range fails with EINVAL
    
    Although EINVAL usually indicates a programming error, ecryptfs (and
    possibly other stacked filesystems) returns EINVAL for attempts to
    copy_file_range() or sendfile() between files on that filesystem.
    
    Resolves: https://gitlab.gnome.org/GNOME/libglnx/-/issues/3

 glnx-fdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glnx-fdio.c b/glnx-fdio.c
index 3fa73b5..fb57280 100644
--- a/glnx-fdio.c
+++ b/glnx-fdio.c
@@ -829,7 +829,7 @@ glnx_regfile_copy_bytes (int fdf, int fdt, off_t max_bytes)
                   have_cfr = 0;
                   try_cfr = false;
                 }
-              else if (G_IN_SET (errno, EXDEV, EOPNOTSUPP))
+              else if (G_IN_SET (errno, EXDEV, EINVAL, EOPNOTSUPP))
                 /* We won't try cfr again for this run, but let's be
                  * conservative and not mark it as available/unavailable until
                  * we know for sure.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]