@@ -139,17 +139,16 @@ static ssize_t nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
nfs4_stateid *cnrs = NULL;
ssize_t ret;
- if (pos_in >= i_size_read(file_inode(file_in)))
- return -EINVAL;
-
if (file_in->f_op != &nfs4_file_operations)
- return -EXDEV;
+ return generic_copy_file_range(file_in, pos_in, file_out,
+ pos_out, count, flags);
if (file_inode(file_in) == file_inode(file_out))
return -EINVAL;
if (!nfs_server_capable(file_inode(file_out), NFS_CAP_COPY))
- return -EOPNOTSUPP;
+ return generic_copy_file_range(file_in, pos_in, file_out,
+ pos_out, count, flags);
retry:
if (!nfs42_files_from_same_server(file_in, file_out)) {
cn_resp = kzalloc(sizeof(struct nfs42_copy_notify_res),
If NFS unable to handle the copy then fallback to the generic VFS copy_file_range functionality. Also remove the offset check, as the check was added at the VFS. Signed-off-by: Olga Kornievskaia <kolga@netapp.com> --- fs/nfs/nfs4file.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)