Commit 8dff1df5 authored by Olga Kornievskaia's avatar Olga Kornievskaia Committed by Olga Kornievskaia
Browse files

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: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatarMatthew Wilcox <willy@infradead.org>
Signed-off-by: default avatarOlga Kornievskaia <kolga@netapp.com>
parent 12751010
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;