]> Git Repo - linux.git/commitdiff
vfs: vfs_clone_file_prep_inodes should return EINVAL for a clone from beyond EOF
authorDarrick J. Wong <[email protected]>
Mon, 29 Oct 2018 23:40:22 +0000 (10:40 +1100)
committerDave Chinner <[email protected]>
Mon, 29 Oct 2018 23:40:22 +0000 (10:40 +1100)
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 <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Dave Chinner <[email protected]>
fs/read_write.c

index 8a2737f0d61d3e0fbef04107da4a11283653544b..260797b0185121c9523da330822b1ca8967136d3 100644 (file)
@@ -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) {
This page took 0.046294 seconds and 4 git commands to generate.