HomeFreeBSD

nfsd: Add a sysctl to limit NFSv4.2 Copy RPC size

Description

nfsd: Add a sysctl to limit NFSv4.2 Copy RPC size

NFSv4.2 supports a Copy operation, which avoids file data being
read to the client and then written back to the server, if both
input and output files are on the same NFSv4.2 mount for
copy_file_range(2).

Unfortunately, this Copy operation can take a long time under
certain circumstances. If this occurs concurrently with a RPC
that requires an exclusive lock on the nfsd such as ExchangeID
done for a new mount, the result can be an nfsd "stall" until
the Copy completes.

This patch adds a sysctl that can be set to limit the size of
a Copy operation or, if set to 0, disable Copy operations.

The use of this sysctl and other ways to avoid Copy operations
taking too long will be documented in the nfsd.4 man page by
a separate commit.

MFC after: 2 weeks

Details

Provenance
rmacklemAuthored on Mar 16 2024, 1:04 AM
Parents
rG4517b7a2d540: Add another commit to .git-blame-ignore-revs
Branches
Unknown
Tags
Unknown