public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mountd: Cleanup how config options are read in
@ 2021-02-01 23:01 Steve Dickson
  2021-02-01 23:01 ` [PATCH 2/2] mountd: Add debug processing from nfs.conf Steve Dickson
  2021-02-02 17:02 ` [PATCH 1/2] mountd: Cleanup how config options are read in Steve Dickson
  0 siblings, 2 replies; 7+ messages in thread
From: Steve Dickson @ 2021-02-01 23:01 UTC (permalink / raw)
  To: Linux NFS Mailing list

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/mountd/mountd.c | 49 +++++++++++++++++++++++++------------------
 1 file changed, 29 insertions(+), 20 deletions(-)

diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
index 07bcdc5a..988e51c5 100644
--- a/utils/mountd/mountd.c
+++ b/utils/mountd/mountd.c
@@ -661,30 +661,17 @@ get_exportlist(void)
 	return elist;
 }
 
-int
-main(int argc, char **argv)
+int	vers;
+int	port = 0;
+int	descriptors = 0;
+
+inline static void 
+read_mount_conf(char **argv)
 {
-	char	*progname;
 	char	*s;
-	unsigned int listeners = 0;
-	int	foreground = 0;
-	int	port = 0;
-	int	descriptors = 0;
-	int	c;
-	int	vers;
-	struct sigaction sa;
-	struct rlimit rlim;
-
-	/* Set the basename */
-	if ((progname = strrchr(argv[0], '/')) != NULL)
-		progname++;
-	else
-		progname = argv[0];
-
-	/* Initialize logging. */
-	xlog_open(progname);
 
 	conf_init_file(NFS_CONFFILE);
+
 	xlog_from_conffile("mountd");
 	manage_gids = conf_get_bool("mountd", "manage-gids", manage_gids);
 	descriptors = conf_get_num("mountd", "descriptors", descriptors);
@@ -714,7 +701,29 @@ main(int argc, char **argv)
 		else
 			NFSCTL_VERUNSET(nfs_version, vers);
 	}
+}
+
+int
+main(int argc, char **argv)
+{
+	char	*progname;
+	unsigned int listeners = 0;
+	int	foreground = 0;
+	int	c;
+	struct sigaction sa;
+	struct rlimit rlim;
+
+	/* Set the basename */
+	if ((progname = strrchr(argv[0], '/')) != NULL)
+		progname++;
+	else
+		progname = argv[0];
+
+	/* Initialize logging. */
+	xlog_open(progname);
 
+	/* Read in config setting */
+	read_mount_conf(argv);
 
 	/* Parse the command line options and arguments. */
 	opterr = 0;
-- 
2.29.2


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

* [PATCH 2/2] mountd: Add debug processing from nfs.conf
  2021-02-01 23:01 [PATCH 1/2] mountd: Cleanup how config options are read in Steve Dickson
@ 2021-02-01 23:01 ` Steve Dickson
  2021-02-02 17:03   ` Steve Dickson
  2021-02-08  0:30   ` NeilBrown
  2021-02-02 17:02 ` [PATCH 1/2] mountd: Cleanup how config options are read in Steve Dickson
  1 sibling, 2 replies; 7+ messages in thread
From: Steve Dickson @ 2021-02-01 23:01 UTC (permalink / raw)
  To: Linux NFS Mailing list

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 nfs.conf              | 2 +-
 utils/mountd/mountd.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/nfs.conf b/nfs.conf
index 186a5b19..9fcf1bf0 100644
--- a/nfs.conf
+++ b/nfs.conf
@@ -30,7 +30,7 @@
 # udp-port=0
 #
 [mountd]
-# debug=0
+# debug="all|auth|call|general|parse"
 # manage-gids=n
 # descriptors=0
 # port=0
diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
index 988e51c5..a480265a 100644
--- a/utils/mountd/mountd.c
+++ b/utils/mountd/mountd.c
@@ -684,6 +684,9 @@ read_mount_conf(char **argv)
 	if (s && !state_setup_basedir(argv[0], s))
 		exit(1);
 
+	if ((s = conf_get_str("mountd", "debug")) != NULL)
+		xlog_sconfig(s, 1);
+
 	/* NOTE: following uses "nfsd" section of nfs.conf !!!! */
 	if (conf_get_bool("nfsd", "udp", NFSCTL_UDPISSET(_rpcprotobits)))
 		NFSCTL_UDPSET(_rpcprotobits);
-- 
2.29.2


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

* Re: [PATCH 1/2] mountd: Cleanup how config options are read in
  2021-02-01 23:01 [PATCH 1/2] mountd: Cleanup how config options are read in Steve Dickson
  2021-02-01 23:01 ` [PATCH 2/2] mountd: Add debug processing from nfs.conf Steve Dickson
@ 2021-02-02 17:02 ` Steve Dickson
  1 sibling, 0 replies; 7+ messages in thread
From: Steve Dickson @ 2021-02-02 17:02 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 2/1/21 6:01 PM, Steve Dickson wrote:
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed... (tag: nfs-utils-2-5-3-rc5)

steved.
> ---
>  utils/mountd/mountd.c | 49 +++++++++++++++++++++++++------------------
>  1 file changed, 29 insertions(+), 20 deletions(-)
> 
> diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
> index 07bcdc5a..988e51c5 100644
> --- a/utils/mountd/mountd.c
> +++ b/utils/mountd/mountd.c
> @@ -661,30 +661,17 @@ get_exportlist(void)
>  	return elist;
>  }
>  
> -int
> -main(int argc, char **argv)
> +int	vers;
> +int	port = 0;
> +int	descriptors = 0;
> +
> +inline static void 
> +read_mount_conf(char **argv)
>  {
> -	char	*progname;
>  	char	*s;
> -	unsigned int listeners = 0;
> -	int	foreground = 0;
> -	int	port = 0;
> -	int	descriptors = 0;
> -	int	c;
> -	int	vers;
> -	struct sigaction sa;
> -	struct rlimit rlim;
> -
> -	/* Set the basename */
> -	if ((progname = strrchr(argv[0], '/')) != NULL)
> -		progname++;
> -	else
> -		progname = argv[0];
> -
> -	/* Initialize logging. */
> -	xlog_open(progname);
>  
>  	conf_init_file(NFS_CONFFILE);
> +
>  	xlog_from_conffile("mountd");
>  	manage_gids = conf_get_bool("mountd", "manage-gids", manage_gids);
>  	descriptors = conf_get_num("mountd", "descriptors", descriptors);
> @@ -714,7 +701,29 @@ main(int argc, char **argv)
>  		else
>  			NFSCTL_VERUNSET(nfs_version, vers);
>  	}
> +}
> +
> +int
> +main(int argc, char **argv)
> +{
> +	char	*progname;
> +	unsigned int listeners = 0;
> +	int	foreground = 0;
> +	int	c;
> +	struct sigaction sa;
> +	struct rlimit rlim;
> +
> +	/* Set the basename */
> +	if ((progname = strrchr(argv[0], '/')) != NULL)
> +		progname++;
> +	else
> +		progname = argv[0];
> +
> +	/* Initialize logging. */
> +	xlog_open(progname);
>  
> +	/* Read in config setting */
> +	read_mount_conf(argv);
>  
>  	/* Parse the command line options and arguments. */
>  	opterr = 0;
> 


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

* Re: [PATCH 2/2] mountd: Add debug processing from nfs.conf
  2021-02-01 23:01 ` [PATCH 2/2] mountd: Add debug processing from nfs.conf Steve Dickson
@ 2021-02-02 17:03   ` Steve Dickson
  2021-02-08  0:30   ` NeilBrown
  1 sibling, 0 replies; 7+ messages in thread
From: Steve Dickson @ 2021-02-02 17:03 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 2/1/21 6:01 PM, Steve Dickson wrote:
> Signed-off-by: Steve Dickson <steved@redhat.com>

Committed... (tag: nfs-utils-2-5-3-rc5)

steved.
> ---
>  nfs.conf              | 2 +-
>  utils/mountd/mountd.c | 3 +++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/nfs.conf b/nfs.conf
> index 186a5b19..9fcf1bf0 100644
> --- a/nfs.conf
> +++ b/nfs.conf
> @@ -30,7 +30,7 @@
>  # udp-port=0
>  #
>  [mountd]
> -# debug=0
> +# debug="all|auth|call|general|parse"
>  # manage-gids=n
>  # descriptors=0
>  # port=0
> diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
> index 988e51c5..a480265a 100644
> --- a/utils/mountd/mountd.c
> +++ b/utils/mountd/mountd.c
> @@ -684,6 +684,9 @@ read_mount_conf(char **argv)
>  	if (s && !state_setup_basedir(argv[0], s))
>  		exit(1);
>  
> +	if ((s = conf_get_str("mountd", "debug")) != NULL)
> +		xlog_sconfig(s, 1);
> +
>  	/* NOTE: following uses "nfsd" section of nfs.conf !!!! */
>  	if (conf_get_bool("nfsd", "udp", NFSCTL_UDPISSET(_rpcprotobits)))
>  		NFSCTL_UDPSET(_rpcprotobits);
> 


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

* Re: [PATCH 2/2] mountd: Add debug processing from nfs.conf
  2021-02-01 23:01 ` [PATCH 2/2] mountd: Add debug processing from nfs.conf Steve Dickson
  2021-02-02 17:03   ` Steve Dickson
@ 2021-02-08  0:30   ` NeilBrown
  2021-02-08 17:44     ` Steve Dickson
  1 sibling, 1 reply; 7+ messages in thread
From: NeilBrown @ 2021-02-08  0:30 UTC (permalink / raw)
  To: Steve Dickson, Linux NFS Mailing list

[-- Attachment #1: Type: text/plain, Size: 1391 bytes --]

On Mon, Feb 01 2021, Steve Dickson wrote:

> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  nfs.conf              | 2 +-
>  utils/mountd/mountd.c | 3 +++
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/nfs.conf b/nfs.conf
> index 186a5b19..9fcf1bf0 100644
> --- a/nfs.conf
> +++ b/nfs.conf
> @@ -30,7 +30,7 @@
>  # udp-port=0
>  #
>  [mountd]
> -# debug=0
> +# debug="all|auth|call|general|parse"
>  # manage-gids=n
>  # descriptors=0
>  # port=0
> diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
> index 988e51c5..a480265a 100644
> --- a/utils/mountd/mountd.c
> +++ b/utils/mountd/mountd.c
> @@ -684,6 +684,9 @@ read_mount_conf(char **argv)
>  	if (s && !state_setup_basedir(argv[0], s))
>  		exit(1);
>  
> +	if ((s = conf_get_str("mountd", "debug")) != NULL)
> +		xlog_sconfig(s, 1);
> +

Why is this needed?
A few lines higher up is
  	xlog_from_conffile("mountd");
which calls
 	kinds = conf_get_list(service, "debug");
and passes each word that it finds to xlog_sconfig()
??

I just tested setting "debug=all" in the mountd section of nfs.conf,
and it seems to work without this patch.

Thanks,
NeilBrown


>  	/* NOTE: following uses "nfsd" section of nfs.conf !!!! */
>  	if (conf_get_bool("nfsd", "udp", NFSCTL_UDPISSET(_rpcprotobits)))
>  		NFSCTL_UDPSET(_rpcprotobits);
> -- 
> 2.29.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]

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

* Re: [PATCH 2/2] mountd: Add debug processing from nfs.conf
  2021-02-08  0:30   ` NeilBrown
@ 2021-02-08 17:44     ` Steve Dickson
  2021-02-08 22:27       ` NeilBrown
  0 siblings, 1 reply; 7+ messages in thread
From: Steve Dickson @ 2021-02-08 17:44 UTC (permalink / raw)
  To: NeilBrown, Linux NFS Mailing list



On 2/7/21 7:30 PM, NeilBrown wrote:
> On Mon, Feb 01 2021, Steve Dickson wrote:
> 
>> Signed-off-by: Steve Dickson <steved@redhat.com>
>> ---
>>  nfs.conf              | 2 +-
>>  utils/mountd/mountd.c | 3 +++
>>  2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/nfs.conf b/nfs.conf
>> index 186a5b19..9fcf1bf0 100644
>> --- a/nfs.conf
>> +++ b/nfs.conf
>> @@ -30,7 +30,7 @@
>>  # udp-port=0
>>  #
>>  [mountd]
>> -# debug=0
>> +# debug="all|auth|call|general|parse"
>>  # manage-gids=n
>>  # descriptors=0
>>  # port=0
>> diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
>> index 988e51c5..a480265a 100644
>> --- a/utils/mountd/mountd.c
>> +++ b/utils/mountd/mountd.c
>> @@ -684,6 +684,9 @@ read_mount_conf(char **argv)
>>  	if (s && !state_setup_basedir(argv[0], s))
>>  		exit(1);
>>  
>> +	if ((s = conf_get_str("mountd", "debug")) != NULL)
>> +		xlog_sconfig(s, 1);
>> +
> 
> Why is this needed?
> A few lines higher up is
>   	xlog_from_conffile("mountd");
> which calls
>  	kinds = conf_get_list(service, "debug");
> and passes each word that it finds to xlog_sconfig()
> ??
> 
> I just tested setting "debug=all" in the mountd section of nfs.conf,
> and it seems to work without this patch.
No it is not... I didn't realize xlog_from_conffile() process
the debug config variable... maybe we should change the name
to something like xlog_debug_conffile()... something more
descriptive as to what it does.

I will clean it up... in a bit.

steved.
> 
> Thanks,
> NeilBrown
> 
> 
>>  	/* NOTE: following uses "nfsd" section of nfs.conf !!!! */
>>  	if (conf_get_bool("nfsd", "udp", NFSCTL_UDPISSET(_rpcprotobits)))
>>  		NFSCTL_UDPSET(_rpcprotobits);
>> -- 
>> 2.29.2


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

* Re: [PATCH 2/2] mountd: Add debug processing from nfs.conf
  2021-02-08 17:44     ` Steve Dickson
@ 2021-02-08 22:27       ` NeilBrown
  0 siblings, 0 replies; 7+ messages in thread
From: NeilBrown @ 2021-02-08 22:27 UTC (permalink / raw)
  To: Steve Dickson, Linux NFS Mailing list

[-- Attachment #1: Type: text/plain, Size: 1773 bytes --]

On Mon, Feb 08 2021, Steve Dickson wrote:

> On 2/7/21 7:30 PM, NeilBrown wrote:
>> On Mon, Feb 01 2021, Steve Dickson wrote:
>> 
>>> Signed-off-by: Steve Dickson <steved@redhat.com>
>>> ---
>>>  nfs.conf              | 2 +-
>>>  utils/mountd/mountd.c | 3 +++
>>>  2 files changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/nfs.conf b/nfs.conf
>>> index 186a5b19..9fcf1bf0 100644
>>> --- a/nfs.conf
>>> +++ b/nfs.conf
>>> @@ -30,7 +30,7 @@
>>>  # udp-port=0
>>>  #
>>>  [mountd]
>>> -# debug=0
>>> +# debug="all|auth|call|general|parse"
>>>  # manage-gids=n
>>>  # descriptors=0
>>>  # port=0
>>> diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
>>> index 988e51c5..a480265a 100644
>>> --- a/utils/mountd/mountd.c
>>> +++ b/utils/mountd/mountd.c
>>> @@ -684,6 +684,9 @@ read_mount_conf(char **argv)
>>>  	if (s && !state_setup_basedir(argv[0], s))
>>>  		exit(1);
>>>  
>>> +	if ((s = conf_get_str("mountd", "debug")) != NULL)
>>> +		xlog_sconfig(s, 1);
>>> +
>> 
>> Why is this needed?
>> A few lines higher up is
>>   	xlog_from_conffile("mountd");
>> which calls
>>  	kinds = conf_get_list(service, "debug");
>> and passes each word that it finds to xlog_sconfig()
>> ??
>> 
>> I just tested setting "debug=all" in the mountd section of nfs.conf,
>> and it seems to work without this patch.
> No it is not... I didn't realize xlog_from_conffile() process
> the debug config variable... maybe we should change the name
> to something like xlog_debug_conffile()... something more
> descriptive as to what it does.
>
> I will clean it up... in a bit.

Thanks.  I agree that including "debug" in that function name would
help. Maybe "conffile_set_debug()", or your suggestion.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]

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

end of thread, other threads:[~2021-02-08 22:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-01 23:01 [PATCH 1/2] mountd: Cleanup how config options are read in Steve Dickson
2021-02-01 23:01 ` [PATCH 2/2] mountd: Add debug processing from nfs.conf Steve Dickson
2021-02-02 17:03   ` Steve Dickson
2021-02-08  0:30   ` NeilBrown
2021-02-08 17:44     ` Steve Dickson
2021-02-08 22:27       ` NeilBrown
2021-02-02 17:02 ` [PATCH 1/2] mountd: Cleanup how config options are read in Steve Dickson

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