From c17db0b838dcb6cbc0ed7d595350f72d7e2f5c7a Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 19 Mar 2024 20:39:53 +0200 Subject: [PATCH] proton: Don't use copy_file_range if fs doesn't support it. --- proton | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proton b/proton index 4334af6a..72c48456 100755 --- a/proton +++ b/proton @@ -229,9 +229,9 @@ def copyfile_reflink(srcname, dstname): while bytes_to_copy > 0: bytes_to_copy -= copy_file_range(src.fileno(), dst.fileno(), bytes_to_copy) except OSError as e: - if e.errno not in (errno.EXDEV, errno.ENOSYS, errno.EINVAL): + if e.errno not in (errno.EXDEV, errno.ENOSYS, errno.EINVAL, errno.EOPNOTSUPP): raise e - if e.errno == errno.ENOSYS: + if e.errno == errno.ENOSYS or e.errno == errno.EOPNOTSUPP: copyfile = shutil.copyfile shutil.copyfile(srcname, dstname)