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.

(cherry picked from commit 748f56c53f4286e0b140c1b779ff8ade1cf4fec9)

Details

Provenance
rmacklemAuthored on Mar 16 2024, 1:04 AM
Parents
rGd9d05e65c1f7: epoch(9): Remove the under-development note
Branches
Unknown
Tags
Unknown