summaryrefslogtreecommitdiff
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-10-30 02:40:22 +0300
committerDave Chinner <david@fromorbit.com>2018-10-30 02:40:22 +0300
commit5b49f64db299d0b3f7c2170088186aa593d0be7d (patch)
treeed7559be897c3e12da7719f6d278e29528d3af90 /fs/read_write.c
parent84df9525b0c27f3ebc2ebb1864fa62a97fdedb7d (diff)
downloadlinux-5b49f64db299d0b3f7c2170088186aa593d0be7d.tar.xz
vfs: vfs_clone_file_prep_inodes should return EINVAL for a clone from beyond EOF
vfs_clone_file_prep_inodes cannot return 0 if it is asked to remap from a zero byte file because that's what btrfs does. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index 8a2737f0d61d..260797b01851 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1740,10 +1740,7 @@ int vfs_clone_file_prep_inodes(struct inode *inode_in, loff_t pos_in,
if (!S_ISREG(inode_in->i_mode) || !S_ISREG(inode_out->i_mode))
return -EINVAL;
- /* Are we going all the way to the end? */
isize = i_size_read(inode_in);
- if (isize == 0)
- return 0;
/* Zero length dedupe exits immediately; reflink goes to EOF. */
if (*len == 0) {