Linux NFS development
 help / color / mirror / Atom feed
From: Scott Mayhew <smayhew@redhat.com>
To: steved@redhat.com
Cc: yoyang@redhat.com, linux-nfs@vger.kernel.org
Subject: [nfs-utils PATCH] nfsdctl: ensure autostart honors the default nfs.conf versX.Y settings
Date: Tue, 18 Mar 2025 16:17:14 -0400	[thread overview]
Message-ID: <20250318201714.1164817-1-smayhew@redhat.com> (raw)

Yongcheng noted that after disabling a versX.Y option in /etc/nfs.conf,
and starting nfsd, subsequently commenting out that option and
restarting nfsd would not result in it being re-enabled.

Reported-by: Yongcheng Yang <yoyang@redhat.com>
Fixes: 03b2e2a1 ("nfsdctl: tweak the nfs.conf version handling")
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 utils/nfsdctl/nfsdctl.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/utils/nfsdctl/nfsdctl.c b/utils/nfsdctl/nfsdctl.c
index 05fecc71..5ea848c9 100644
--- a/utils/nfsdctl/nfsdctl.c
+++ b/utils/nfsdctl/nfsdctl.c
@@ -1318,6 +1318,18 @@ static int configure_versions(void)
 	bool found_one = false;
 	char tag[20];
 
+	/*
+	 * First apply the default versX.Y settings from nfs.conf.
+	 */
+	update_nfsd_version(3, 0, true);
+	update_nfsd_version(4, 0, true);
+	update_nfsd_version(4, 1, true);
+	update_nfsd_version(4, 2, true);
+
+	/*
+	 * Then apply any versX.Y settings that are explicitly set in
+	 * nfs.conf.
+	 */
 	for (i = 2; i <= 4; ++i) {
 		sprintf(tag, "vers%d", i);
 		if (!conf_get_bool("nfsd", tag, true)) {
-- 
2.47.1


             reply	other threads:[~2025-03-18 20:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 20:17 Scott Mayhew [this message]
2025-03-19 19:49 ` [nfs-utils PATCH] nfsdctl: ensure autostart honors the default nfs.conf versX.Y settings Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250318201714.1164817-1-smayhew@redhat.com \
    --to=smayhew@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    --cc=yoyang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox