Linux NFS development
 help / color / mirror / Atom feed
* [nfs-utils PATCH] nfsdctl: ensure autostart honors the default nfs.conf versX.Y settings
@ 2025-03-18 20:17 Scott Mayhew
  2025-03-19 19:49 ` Steve Dickson
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Mayhew @ 2025-03-18 20:17 UTC (permalink / raw)
  To: steved; +Cc: yoyang, linux-nfs

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [nfs-utils PATCH] nfsdctl: ensure autostart honors the default nfs.conf versX.Y settings
  2025-03-18 20:17 [nfs-utils PATCH] nfsdctl: ensure autostart honors the default nfs.conf versX.Y settings Scott Mayhew
@ 2025-03-19 19:49 ` Steve Dickson
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2025-03-19 19:49 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: yoyang, linux-nfs



On 3/18/25 4:17 PM, Scott Mayhew wrote:
> 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>
Committed... (tag: nfs-utils-2-8-3-rc7)

steved.
> ---
>   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)) {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-19 19:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-18 20:17 [nfs-utils PATCH] nfsdctl: ensure autostart honors the default nfs.conf versX.Y settings Scott Mayhew
2025-03-19 19:49 ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox