From nobody Mon Jul 04 13:00:37 2022 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 53F428AA1FB; Mon, 4 Jul 2022 13:00:37 +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 4Lc5Wn1vl8z56Wm; Mon, 4 Jul 2022 13:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656939637; 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=F2jaiHhl1FNBBRQfPMl/+JTk4Lvsl68BulDjc2g5OYg=; b=WvhuhUC0jy3FGmiA3YdCwowP7V0lF2notpnEh+qPML7FOGP5hSif26jssaLMVvzUtcLA0i PdGyI37GnpX3kSCp+cFejaXMEofjapCHR48laHGp9zxhy4C74fLeBMzvdw4QBN/vrgdSJ8 jqN3ySxtjX51lEwnfBkznTxtY9D+4e+zrl1BvtPeFnnL2a2LsV1Sf425UlqeFREXWgEPYu RkrORZngrdbdR+U6GOaLP+cgx+cA3/LE4vvKseRG4KHGE62Kmxg5PBo3HccX8Oa9HAHxLE lt1n05fC8Rs4F8LijZNTVg3RHg/cntZXD9u6VHcAMy7h92A+IX4P+XvXbIvwiA== 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 215CB115F7; Mon, 4 Jul 2022 13:00:37 +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 264D0bZF051816; Mon, 4 Jul 2022 13:00:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 264D0b7p051815; Mon, 4 Jul 2022 13:00:37 GMT (envelope-from git) Date: Mon, 4 Jul 2022 13:00:37 GMT Message-Id: <202207041300.264D0b7p051815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 1cf8e6339e9a - main - mountd startup: enable NFSv4 if needed on restart 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: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cf8e6339e9add47107a6c9988a0f509225b7ef6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656939637; 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=F2jaiHhl1FNBBRQfPMl/+JTk4Lvsl68BulDjc2g5OYg=; b=tVbWebuZ8C0YyFfaFgiNvpcNruuUqFXdlV18D5zOyZ0h3or6XPsixakVz3Y15Nb1dvafz5 vNPH8MmPG+3GOb8EzJEcif5vwW1HePGzAdYG8o8bzpEyvC2+s0BiSqhj6QtwRpfJBYVoAS PcEl8QBxzyJewBhAPlCd0cxD6J/xlo/Ulz+onjVg2jqVDSkdXvqckYbi76Rt9wAtbP5hzK KRnfVFmvRpVyekaM+CBQiLDxOJDxmhCMaF6RW7/+i5QOjFhi2wd3l0ws5ocF7Fofh6YkvC TSFc1FmpQfo5tWM1P/AmPQTio2ZNY/Gwyzit0VpeyzjAwr63kz71M8REyLwh2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656939637; a=rsa-sha256; cv=none; b=A9NgozMkCHo3Deob7fB5hhUVWehC43FtZruyRMSk10hIgFCk8aqkffkgSjiCDLlpQ1q4ns P54sl8y8Q58L14vI+8fffdJSMq+6ZkJShmy224iGULBnw2q4vQzgZKFJ2ZYgF5r9PwbDM9 /bBBt9MncEnwQKt11DwlhbcKVoVjxl6CLbBU3paAsp65kXV8Sklipd6TpH/Wuru5Uv3XXC IyswPldL1JE0Yx/ZGRknrPeLCdhj6bEY10LYaAFOpEWvefd5qvD95FJfSsoLpE7aCGusNN f8tDJiBx3ULcCnpghKUcoLUUp3IsahB2lj+vr0oT6jbXrpI9HGhtHNrAgxqHTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=1cf8e6339e9add47107a6c9988a0f509225b7ef6 commit 1cf8e6339e9add47107a6c9988a0f509225b7ef6 Author: Mike Karels AuthorDate: 2022-07-03 23:04:41 +0000 Commit: Mike Karels CommitDate: 2022-07-04 13:00:10 +0000 mountd startup: enable NFSv4 if needed on restart The mountd script in rc.d sets vfs.nfsd.server_max_nfsvers correctly when it is run at system startup, relying on the kernel default. However, if NFSv4 was enabled in /etc/rc.conf later, and the script was re-run to restart mountd, the sysctl was still set to 3. Set the sysctl to the right value in all cases. Reviewed by: rmacklem MFC after: 1 week --- libexec/rc/rc.d/mountd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/mountd b/libexec/rc/rc.d/mountd index 0c6e75f07d64..d75416736245 100755 --- a/libexec/rc/rc.d/mountd +++ b/libexec/rc/rc.d/mountd @@ -34,7 +34,9 @@ mountd_precmd() rc_flags="${rc_flags} -R" else force_depend rpcbind || return 1 - if ! checkyesno nfsv4_server_enable; then + if checkyesno nfsv4_server_enable; then + sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null + else sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null fi fi