git: efe287822bcb - stable/15 - nfsd: Allow vfs.nfsd.srvmaxio to be up to 4Mbytes
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 28 May 2026 02:47:08 UTC
The branch stable/15 has been updated by rmacklem:
URL: https://cgit.FreeBSD.org/src/commit/?id=efe287822bcbebbf5ad5448280c6d91aa3676fe4
commit efe287822bcbebbf5ad5448280c6d91aa3676fe4
Author: Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2026-05-14 22:33:23 +0000
Commit: Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2026-05-28 02:45:54 +0000
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.)
(cherry picked from commit b92b9da3300655c86dcd42ea8a5ba45badd90847)
---
sys/fs/nfs/nfsproto.h | 3 +++
sys/fs/nfsserver/nfs_nfsdport.c | 5 +++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h
index 6e67c5be3416..1054c85d8e8f 100644
--- a/sys/fs/nfs/nfsproto.h
+++ b/sys/fs/nfs/nfsproto.h
@@ -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) */
/*
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index 63f7b5ecf564..a33b5ed620a2 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -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) {