Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Dec 2021 22:05:19 GMT
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2cd26a286a9e - stable/13 - nfsd: Add a new rc variable nfs_server_maxio
Message-ID:  <202112012205.1B1M5Jco014614@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=2cd26a286a9e6339a3c6782a7101cbbd5d166666

commit 2cd26a286a9e6339a3c6782a7101cbbd5d166666
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2021-11-17 00:02:53 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2021-12-01 22:01:57 +0000

    nfsd: Add a new rc variable nfs_server_maxio
    
    Since vfs.nfsd.srvmaxio can only be set when nfsd.ko
    is loaded, but nfsd is not running, setting it in
    /etc/sysctl.conf is not feasible when "options NFSD"
    was not specified for the kernel.
    
    This patch adds a new rc variable nfs_server_maxio,
    which sets vfs.nfsd.srvmaxio at the correct time.
    
    rc.conf.5 will be patched separately.
    
    (cherry picked from commit 5509bad74e44eed3b9d54fbd74d3752b88428147)
---
 libexec/rc/rc.conf   | 1 +
 libexec/rc/rc.d/nfsd | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf
index e4fc9a1d75fe..9336a9d91004 100644
--- a/libexec/rc/rc.conf
+++ b/libexec/rc/rc.conf
@@ -360,6 +360,7 @@ nfs_access_cache="60"		# Client cache timeout in seconds
 nfs_server_enable="NO"		# This host is an NFS server (or NO).
 nfs_server_flags="-u -t"	# Flags to nfsd (if enabled).
 nfs_server_managegids="NO"	# The NFS server maps gids for AUTH_SYS (or NO).
+nfs_server_maxio="131072"	# Maximum I/O size for the nfsd.
 mountd_enable="NO"		# Run mountd (or NO).
 mountd_flags="-r -S"		# Flags to mountd (if NFS server enabled).
 weak_mountd_authentication="NO"	# Allow non-root mount requests to be served.
diff --git a/libexec/rc/rc.d/nfsd b/libexec/rc/rc.d/nfsd
index 1d0689b3beb7..b746cf7cea9d 100755
--- a/libexec/rc/rc.d/nfsd
+++ b/libexec/rc/rc.d/nfsd
@@ -28,6 +28,12 @@ nfsd_precmd()
 	# oids are available.
 	load_kld nfsd || return 1
 
+	if [ -n "${nfs_server_maxio}" ]; then
+		if ! sysctl vfs.nfsd.srvmaxio=${nfs_server_maxio} >/dev/null; then
+			warn "Failed to set server max I/O"
+		fi
+	fi
+
 	if checkyesno nfs_reserved_port_only; then
 		echo 'NFS on reserved port only=YES'
 		sysctl vfs.nfsd.nfs_privport=1 > /dev/null



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112012205.1B1M5Jco014614>