1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00

nfsd: Allow vfs.nfsd.srvmaxio to be up to 4Mbytes

Without this patch, the maximum setting for
vfs.nfsd.srvmaxio was 1Mbyte.  This patch increases
that to 4Mbytes.

The same as for any setting above 128Kbytes, settings up to
4Mbytes require that kern.ipc.maxsockbuf be increased.
(A message generated after setting vfs.nfsd.srvmaxio via
the /etc/rc.conf variable nfs_server_maxio will indicate
the minimum setting, which will be somewhat greater than
four times the setting of vfs.nfsd.srvmaxio.)

Requested by:	Cedric Blancher <cedric.blancher@gmail.com>
MFC after:	2 weeks
Fixes:	13d3bd165e ("subr_uio.c: Remove a KASSERT() for large NFS server I/O")
This commit is contained in:
Rick Macklem
2026-05-14 15:33:23 -07:00
parent 13d3bd165e
commit b92b9da330
2 changed files with 6 additions and 2 deletions
+3
View File
@@ -89,8 +89,11 @@
* It used to be called NFS_MAXDATA, but has been renamed to clarify that
* it refers to server side only and doesn't conflict with the NFS_MAXDATA
* defined in rpcsvc/nfs_prot.h for userland.
* NFS_SRVMAXIO is the default setting for vfs.nfsd.srvmaxio
* NFS_SRVLIMITIO is the maximum setting allowed for vfs.nfsd.srvmaxio
*/
#define NFS_SRVMAXIO (128 * 1024)
#define NFS_SRVLIMITIO (4 * 1024 * 1024)
/* Stat numbers for rpc returns (version 2, 3 and 4) */
/*
+3 -2
View File
@@ -241,8 +241,9 @@ sysctl_srvmaxio(SYSCTL_HANDLER_ARGS)
printf("nfsd: vfs.nfsd.srvmaxio can only be increased\n");
return (EINVAL);
}
if (newsrvmaxio > 1048576) {
printf("nfsd: vfs.nfsd.srvmaxio cannot be > 1Mbyte\n");
if (newsrvmaxio > NFS_SRVLIMITIO) {
printf("nfsd: vfs.nfsd.srvmaxio cannot be > %d\n",
NFS_SRVLIMITIO);
return (EINVAL);
}
if ((newsrvmaxio & (newsrvmaxio - 1)) != 0) {