diff options
author | Jonathan Lebon <jonathan@jlebon.com> | 2020-06-16 12:29:46 -0400 |
---|---|---|
committer | Jonathan Lebon <jonathan@jlebon.com> | 2020-06-16 14:42:13 -0400 |
commit | 7e3a19958e6af94b764c772a58adf47e6cc4b678 (patch) | |
tree | 4684b39082511a2fab7533693391b2eaa76c5199 /glnx-fdio.c | |
parent | 3c285a7b3a3335a24aadd56df6d7bb0beb0604e8 (diff) | |
download | libglnx-7e3a19958e6af94b764c772a58adf47e6cc4b678.tar.gz |
glnx-fdio: handle EOPNOTSUPP for copy_file_range
When using `copy_file_range` to target a source and dest on the same NFS
mount on some older kernel versions, it's possible that we can get
`EOPNOTSUPP` e.g. if the NFS server doesn't support server-side copy.
We hit this in the FCOS release pipeline where we run `ostree
pull-local` to pull content between two repos on the same mount from
inside an OpenShift cluster on top of RHEL7.
Nowadays, it seems like the kernel itself falls back to a more generic
version of `copy_file_range()` at least. Though to be compatible with
older kernels, let's add `EOPNOTSUPP` to the list of errors we interpret
as "cfr possibly available, but can't be done for this specific
operation".
Diffstat (limited to 'glnx-fdio.c')
-rw-r--r-- | glnx-fdio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/glnx-fdio.c b/glnx-fdio.c index 6ae6ec7..e537a9b 100644 --- a/glnx-fdio.c +++ b/glnx-fdio.c @@ -826,7 +826,7 @@ glnx_regfile_copy_bytes (int fdf, int fdt, off_t max_bytes) have_cfr = 0; try_cfr = false; } - else if (errno == EXDEV) + else if (G_IN_SET (errno, EXDEV, 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. |