HomeFreeBSD

Add vfs.nfsd.checkcopysize to enable a check for Copy past input file EOF.

Description

Add vfs.nfsd.checkcopysize to enable a check for Copy past input file EOF.

RFC-7862 requires that a NFSv4.2 server reply NFSERR_INVAL when the
offset of the input file plus length exceeds the file's size.
However, the Linux NFSv4.2 client likes to do this and will break when
this check is done.
As such, this patch adds the check, but it only enabled when
vfs.nfsd.checkcopysize is set non-zero.
The patch also adds a needed check for nd->nd_repstat == 0 before calling
vn_copy_file_range().
Found during interoperability testing with Linux.

Details

Provenance
rmacklemAuthored on
Parents
rS353709: Remove obsolete, non-use of CLANG_NO_IAS.
Branches
Unknown
Tags
Unknown