HomeFreeBSD

Make copy_file_range(2) Linux compatible for overflow of offset + len.

Description

Make copy_file_range(2) Linux compatible for overflow of offset + len.

Without this patch, if a call to copy_file_range(2) specifies an input file
offset + len that would wrap around, EINVAL is returned.
I thought that was the Linux behaviour, but recent testing showed that
Linux accepts this case and does the copy_file_range() to EOF.

This patch changes the FreeBSD code to exhibit the same behaviour as
Linux for this case.

Reviewed by: asomers, kib
Differential Revision: https://reviews.freebsd.org/D26569