From nobody Wed Dec 01 22:05:19 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 D5B8918BC9F9; Wed, 1 Dec 2021 22:05:19 +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 4J4CnW3hzZz3mxy; Wed, 1 Dec 2021 22:05:19 +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 5EECD11F4D; Wed, 1 Dec 2021 22:05:19 +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 1B1M5JFq014615; Wed, 1 Dec 2021 22:05:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1M5Jco014614; Wed, 1 Dec 2021 22:05:19 GMT (envelope-from git) Date: Wed, 1 Dec 2021 22:05:19 GMT Message-Id: <202112012205.1B1M5Jco014614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 2cd26a286a9e - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2cd26a286a9e6339a3c6782a7101cbbd5d166666 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638396319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MZ//AE9OVL58fBGZYSiy1LZE0AZo1nGjs2XpryZ16P4=; b=jdThU3gyDjWlrxPV/g37VP8HsAuJW4hsP+hnh7mnAwTjUwEu+tGPjE9UxfytDu10Bi39c+ 74Vb5ZGysqE7u+D9YpCb3vqN59A86irmBWORI7xlWJk0kWWkV1tVB/PCuCGNqy67dlW0U/ ssl0t63UjbxL3TzTBckjuYPeY/EVYg89fRHMZ0mJm1gCs8PbRGiyJ7WR0yz+O07UsUgQxO l8x9zM66a9lmNlDrQtD9P9WIofAVyHtnZs+RujhA4nvhRTWorUPtWqc66Mife6foHO9vJ3 N+rJqoVseiprpbW2Dyw//P+FuI7ojUEAX5R6ovtPC9AxixvKcyRSsocUsn0XZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638396319; a=rsa-sha256; cv=none; b=l/eO7VNTWh402haEzBCQ1UFyQVHyHUtAnkEz7GRiwgWBOlklt3o5lyCk94m5lBfRMecrpK eU3KtpoDn+pujxHz6Al6o8+UFoeDZ0dJzT9VliMn9Dq3dUxrUnPpaKnyJcKkOnSHA0Qb6p oxxcw9z3wyuapv8tC+qanXSP2/UA7BykiEIAxT3HVRSMKAtvYsR7foEeqf/JiKytSm9L6r fTAw+hqPFsFCPc4s/x8N0OdPsieHVGboh1CDxrWtnK4QoSolZPKrrB5hK8+oKDRFD3Uy9a QhURjKmCu7eU481EbZnJy2Z+DwsBVh0DGStKcf0oNHAnjvlSrXt0QrGdbdrVZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2cd26a286a9e6339a3c6782a7101cbbd5d166666 commit 2cd26a286a9e6339a3c6782a7101cbbd5d166666 Author: Rick Macklem AuthorDate: 2021-11-17 00:02:53 +0000 Commit: Rick Macklem 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