If tmpfs is used for /tmp and blob device is not specified, we need to
copy data between two different file systems during mkfs, which is not
supported by the copy_file_range() syscall. In this case, let's give it
a second chance by fallback to __erofs_copy_file_range().

Signed-off-by: Yifan Zhao <[email protected]>
---
 lib/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/io.c b/lib/io.c
index 9d718ab..1d266a5 100644
--- a/lib/io.c
+++ b/lib/io.c
@@ -387,7 +387,7 @@ ssize_t erofs_copy_file_range(int fd_in, erofs_off_t 
*off_in,
                              length, 0);
        if (ret >= 0)
                goto out;
-       if (errno != ENOSYS) {
+       if (errno != ENOSYS && errno != EXDEV) {
                ret = -errno;
 out:
                *off_in = off64_in;
-- 
2.41.0

Reply via email to