vfs: fix isize/pos/len checks for reflink & dedupe

Strengthen the checking of pos/len vs. i_size, clarify the return values
for the clone prep function, and remove pointless code.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Darrick J. Wong
2016-12-19 15:13:26 -08:00
gecommit door Al Viro
bovenliggende 33844e6651
commit 22725ce4e4
3 gewijzigde bestanden met toevoegingen van 13 en 9 verwijderingen

Bestand weergeven

@@ -4834,7 +4834,7 @@ int ocfs2_reflink_remap_range(struct file *file_in,
ret = vfs_clone_file_prep_inodes(inode_in, pos_in, inode_out, pos_out,
&len, is_dedupe);
if (ret || len == 0)
if (ret <= 0)
goto out_unlock;
/* Lock out changes to the allocation maps and remap. */