]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/os/linux/zfs/zpl_file_range.c
copy_file_range: fix fallback when source create on same txg
[mirror_zfs.git] / module / os / linux / zfs / zpl_file_range.c
index 43ba9a4982023023da689523035d15159c3824a7..2abbf44df5879afc7607379dfe00309dc3f8d2cc 100644 (file)
@@ -103,7 +103,8 @@ zpl_copy_file_range(struct file *src_file, loff_t src_off,
         * Since Linux 5.3 the filesystem driver is responsible for executing
         * an appropriate fallback, and a generic fallback function is provided.
         */
-       if (ret == -EOPNOTSUPP || ret == -EINVAL || ret == -EXDEV)
+       if (ret == -EOPNOTSUPP || ret == -EINVAL || ret == -EXDEV ||
+           ret == -EAGAIN)
                ret = generic_copy_file_range(src_file, src_off, dst_file,
                    dst_off, len, flags);
 #else
@@ -111,7 +112,7 @@ zpl_copy_file_range(struct file *src_file, loff_t src_off,
         * Before Linux 5.3 the filesystem has to return -EOPNOTSUPP to signal
         * to the kernel that it should fallback to a content copy.
         */
-       if (ret == -EINVAL || ret == -EXDEV)
+       if (ret == -EINVAL || ret == -EXDEV || ret == -EAGAIN)
                ret = -EOPNOTSUPP;
 #endif /* HAVE_VFS_GENERIC_COPY_FILE_RANGE */