summaryrefslogtreecommitdiffstats
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 4c20bf61d9c3..dc342edb399b 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -3142,6 +3142,9 @@ static ssize_t __fuse_copy_file_range(struct file *file_in, loff_t pos_in,
if (fc->no_copy_file_range)
return -EOPNOTSUPP;
+ if (file_inode(file_in)->i_sb != file_inode(file_out)->i_sb)
+ return -EXDEV;
+
if (fc->writeback_cache) {
inode_lock(inode_in);
err = fuse_writeback_range(inode_in, pos_in, pos_in + len);
@@ -3203,7 +3206,7 @@ static ssize_t fuse_copy_file_range(struct file *src_file, loff_t src_off,
ret = __fuse_copy_file_range(src_file, src_off, dst_file, dst_off,
len, flags);
- if (ret == -EOPNOTSUPP)
+ if (ret == -EOPNOTSUPP || ret == -EXDEV)
ret = generic_copy_file_range(src_file, src_off, dst_file,
dst_off, len, flags);
return ret;