From nobody Wed Nov 17 00:06:40 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F392D188B65B; Wed, 17 Nov 2021 00:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hv3BS6SQnz3sxT; Wed, 17 Nov 2021 00:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE40A1724E; Wed, 17 Nov 2021 00:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AH06e1M032824; Wed, 17 Nov 2021 00:06:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AH06eTo032823; Wed, 17 Nov 2021 00:06:40 GMT (envelope-from git) Date: Wed, 17 Nov 2021 00:06:40 GMT Message-Id: <202111170006.1AH06eTo032823@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 5509bad74e44 - main - nfsd: Add a new rc variable nfs_server_maxio List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5509bad74e44eed3b9d54fbd74d3752b88428147 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5509bad74e44eed3b9d54fbd74d3752b88428147 commit 5509bad74e44eed3b9d54fbd74d3752b88428147 Author: Rick Macklem AuthorDate: 2021-11-17 00:02:53 +0000 Commit: Rick Macklem CommitDate: 2021-11-17 00:02:53 +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. Reviewed by: 0mp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D32997 --- 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 0cfee2d9c194..b27e1154a5e7 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -359,6 +359,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