mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-29 13:00:35 +00:00
vfs: exit early from zero length remap operations
If a remap caller asks us to remap to the source file's EOF and the source file length leaves us with a zero byte request, exit early. 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>
This commit is contained in:
parent
1383a7ed67
commit
2c5773f102
@ -1748,6 +1748,8 @@ int vfs_clone_file_prep(struct file *file_in, loff_t pos_in,
|
||||
if (pos_in > isize)
|
||||
return -EINVAL;
|
||||
*len = isize - pos_in;
|
||||
if (*len == 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Check that we don't violate system file offset limits. */
|
||||
|
Loading…
Reference in New Issue
Block a user