Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jul 2022 12:45:32 GMT
From:      Mike Karels <karels@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 1668ea8284b2 - stable/12 - mountd startup: enable NFSv4 if needed on restart
Message-ID:  <202207111245.26BCjWaj016968@gitrepo.freebsd.org>

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

URL: https://cgit.FreeBSD.org/src/commit/?id=1668ea8284b230b15fc8f096fe2110ef3546f933

commit 1668ea8284b230b15fc8f096fe2110ef3546f933
Author:     Mike Karels <karels@FreeBSD.org>
AuthorDate: 2022-07-03 23:04:41 +0000
Commit:     Mike Karels <karels@FreeBSD.org>
CommitDate: 2022-07-11 12:45:02 +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
    
    (cherry picked from commit 1cf8e6339e9add47107a6c9988a0f509225b7ef6)
---
 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 ba573ad732cc..2ee61e7c4884 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



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