summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorOlga Kornievskaia <kolga@netapp.com>2019-07-02 15:11:48 -0400
committerOlga Kornievskaia <olga.kornievskaia@gmail.com>2019-10-09 12:06:26 -0400
commit8dff1df551dffc29fa78771c8dda2f0b094003aa (patch)
tree3f794a5c5314ee56bb9f16d4c9079d8866e80fcb /fs/nfs
parent1275101026b48f43e194de074b11ab04fee8b89b (diff)
NFS: replace cross device check in copy_file_range
Add a check to disallow cross file systems copy offload, both files are expected to be of NFS4.2+ type. Reviewed-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Matthew Wilcox <willy@infradead.org> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index 897832564923..e97813b15e23 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -141,7 +141,7 @@ static ssize_t __nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
bool sync = false;
/* Only offload copy if superblock is the same */
- if (file_inode(file_in)->i_sb != file_inode(file_out)->i_sb)
+ if (file_in->f_op != &nfs4_file_operations)
return -EXDEV;
if (!nfs_server_capable(file_inode(file_out), NFS_CAP_COPY))
return -EOPNOTSUPP;