From 64d240ea25befa032cc8c8f96328fcb896ead639 Mon Sep 17 00:00:00 2001
From: Esme Povirk <esme@codeweavers.com>
Date: Mon, 18 Apr 2022 11:14:03 -0500
Subject: [PATCH] Accept EINVAL result from copy_file_range.

Apparently, ecryptfs can give this result for regular files.

For #5769.
---
 proton | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proton b/proton
index 84f99955..52e62fa8 100755
--- a/proton
+++ b/proton
@@ -223,7 +223,7 @@ 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 != errno.EXDEV and e.errno != errno.ENOSYS:
+            if e.errno not in (errno.EXDEV, errno.ENOSYS, errno.EINVAL):
                 raise e
             if e.errno == errno.ENOSYS:
                 copyfile = shutil.copyfile