]> git.ipfire.org Git - thirdparty/coreutils.git/commit
copy: fix --reflink=auto to fallback in more cases
authorPádraig Brady <P@draigBrady.com>
Thu, 23 Mar 2023 13:19:04 +0000 (13:19 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 24 Mar 2023 13:12:51 +0000 (13:12 +0000)
commit093a8b4bfaba60005f14493ce7ef11ed665a0176
tree11afbec5f8b202edc98c622340acd5bbd58e9ae5
parent55456b95d8209ebc09916d40aa28e34cdc16c929
copy: fix --reflink=auto to fallback in more cases

On restricted systems like android or some containers,
FICLONE could return EPERM, EACCES, or ENOTTY,
which would have induced the command to fail to copy
rather than falling back to a more standard copy.

* src/copy.c (is_terminal_failure): A new function refactored
from handle_clone_fail().
(is_CLONENOTSUP): Merge in the handling of EACCES, ENOTTY, EPERM
as they also pertain to determination of whether cloning is supported
if we ever use this function in that context.
(handle_clone_fail): Use is_terminal_failure() in all cases,
so that we assume a terminal failure in less errno cases.
* NEWS: Mention the bug fix.
Addresses https://bugs.gnu.org/62404
NEWS
src/copy.c