HomeFreeBSD

copy_file_range(2): Fix for small values of input file offset and len

Description

copy_file_range(2): Fix for small values of input file offset and len

r366302 broke copy_file_range(2) for small values of
input file offset and len.

It was possible for rem to be greater than len and then
"len - rem" was a large value, since both variables are
unsigned.

Approved by: re (gjb)

(cherry picked from commit a5f9fe2bab789f49e8b53da3a62dbd34725e23ea)

Details

Provenance
rmacklemAuthored on Mar 1 2021, 2:28 PM
Parents
rG20f9e2a723f5: rmlock: Add a required compiler membar to the rlock slow path
Branches
Unknown
Tags
Unknown