rmacklem@ spotted two things in the system call:
- Upon returning from a successful operation, vop_stddeallocate can
update rmsr.r_offset to a value greater than file size. This behavior,
although being harmless, can be confusing.
- The EINVAL return value for rqsr.r_offset + rqsr.r_len > OFF_MAX is
undocumented.
This commit changes vop_stddeallocate to not update *ap->a_offset when
the VOP call succeeds with *ap->a_len == 0. It also updates the manual
page for callers to not consider the value of rmsr.r_offset if the call
returns success. The EINVAL case for rqsr.r_offset + rqsr.r_len >
OFF_MAX is documented as well.
Sponsored by: The FreeBSD Foundation