Skip to content

Commit 8dff1df

Browse files
olgakorn1Olga Kornievskaia
authored andcommitted
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 <[email protected]> Reviewed-by: Matthew Wilcox <[email protected]> Signed-off-by: Olga Kornievskaia <[email protected]>
1 parent 1275101 commit 8dff1df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/nfs4file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static ssize_t __nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
141141
bool sync = false;
142142

143143
/* Only offload copy if superblock is the same */
144-
if (file_inode(file_in)->i_sb != file_inode(file_out)->i_sb)
144+
if (file_in->f_op != &nfs4_file_operations)
145145
return -EXDEV;
146146
if (!nfs_server_capable(file_inode(file_out), NFS_CAP_COPY))
147147
return -EOPNOTSUPP;

0 commit comments

Comments
 (0)