summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Leidinger <oleid@mescharet.de>2022-01-24 16:12:57 +0100
committerSimon McVittie <smcv@debian.org>2022-01-28 10:44:59 +0000
commit24231a956a4b849087fbf01173cdebb53e1bd60b (patch)
tree14744795b0cadc6ba75c4c636a409f059b9d93e7
parentef502aabf7d3a0d37f9c4d228f870ac93404447b (diff)
downloadlibglnx-24231a956a4b849087fbf01173cdebb53e1bd60b.tar.gz
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
-rw-r--r--glnx-fdio.c2
1 files changed, 1 insertions, 1 deletions
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.