2021-02-01 23:03:29

by Steve Dickson

[permalink] [raw]
Subject: [PATCH 2/2] mountd: Add debug processing from nfs.conf

Signed-off-by: Steve Dickson <[email protected]>
---
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


2021-02-02 17:10:41

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH 2/2] mountd: Add debug processing from nfs.conf



On 2/1/21 6:01 PM, Steve Dickson wrote:
> Signed-off-by: Steve Dickson <[email protected]>

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);
>

2021-02-08 00:32:34

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH 2/2] mountd: Add debug processing from nfs.conf

On Mon, Feb 01 2021, Steve Dickson wrote:

> Signed-off-by: Steve Dickson <[email protected]>
> ---
> 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


Attachments:
signature.asc (873.00 B)

2021-02-08 17:50:21

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH 2/2] mountd: Add debug processing from nfs.conf



On 2/7/21 7:30 PM, NeilBrown wrote:
> On Mon, Feb 01 2021, Steve Dickson wrote:
>
>> Signed-off-by: Steve Dickson <[email protected]>
>> ---
>> 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

2021-02-08 22:31:03

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH 2/2] mountd: Add debug processing from nfs.conf

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 <[email protected]>
>>> ---
>>> 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


Attachments:
signature.asc (873.00 B)