copy: ignore -EOPNOTSUPP from copy_file_range()
authorNick Rosbrook <enr0n@ubuntu.com>
Thu, 18 Apr 2024 16:01:42 +0000 (12:01 -0400)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 19 Apr 2024 00:57:25 +0000 (09:57 +0900)
According to copy_file_range (2), errno will be set to EOPNOTSUPP when
the file system does not support copy_file_range(). Since there is
already fallback logic in place here for other kinds of errors, add
-EOPNOTSUPP to the list of ignored errors.

src/shared/copy.c

index 2374fa3b62f9f705526c48ed34a32f62428cb451..8389774db75e601065aa0bf2dd7164b5176d5a68 100644 (file)
@@ -335,7 +335,7 @@ int copy_bytes_full(
                 if (try_cfr) {
                         n = try_copy_file_range(fdf, NULL, fdt, NULL, m, 0u);
                         if (n < 0) {
-                                if (!IN_SET(n, -EINVAL, -ENOSYS, -EXDEV, -EBADF))
+                                if (!IN_SET(n, -EINVAL, -ENOSYS, -EXDEV, -EBADF, -EOPNOTSUPP))
                                         return n;
 
                                 try_cfr = false;