nfsd: Demote UMH upcall init message from warning- to info-level
Subsystems (2)
PATCH 1/1 nfsd: Demote UMH upcall init message from warning- to info-level
By default, using printk(), Linux logs messages with level warning, which leaves the user seeing
NFSD: Using UMH upcall client tracking operations.
what to do about it. Reading nfsd4_umh_cltrack_init(), the message is actually logged on success, so nothing needs to be done, and the info level should be used.
--- fs/nfsd/nfs4recover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4recover.c +1 -1
@@ -1864,7 +1864,7 @@ nfsd4_umh_cltrack_init(struct net *net) ret =nfsd4_umh_cltrack_upcall ("init" ,NULL , grace_start,NULL );kfree (grace_start);if (!ret) -printk ("NFSD: Using UMH upcall client tracking operations.\n" ); +pr_info ("NFSD: Using UMH upcall client tracking operations.\n" );return ret; }
Signature · 1 line
2.30.2
Dear Linux folks,
Am 12.03.21 um 12:28 schrieb Paul Menzel:
Quoted 20 lines
By default, using
printk(), Linux logs messages with level warning, which leaves the user seeingNFSD: Using UMH upcall client tracking operations.
what to do about it. Reading
nfsd4_umh_cltrack_init(), the message is actually logged on success, so nothing needs to be done, and the info level should be used.Signed-off-by Paul Menzel <[email protected]>--- fs/nfsd/nfs4recover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/nfsd/nfs4recover.c +0
-0
fs/nfsd/nfs4recover.c nfsd4_umh_cltrack_init(struct net *net) · line 1869
Quoted 7 lines
fs/nfsd/nfs4recover.c +1
-1@@ -1864,7 +1864,7 @@ nfsd4_umh_cltrack_init(struct net *net) ret =nfsd4_umh_cltrack_upcall ("init" ,NULL , grace_start,NULL );kfree (grace_start);if (!ret) -printk ("NFSD: Using UMH upcall client tracking operations.\n" ); +pr_info ("NFSD: Using UMH upcall client tracking operations.\n" );return ret; }
A debug-level message could also be used, or the line totally removed, and the condition be changed to print an error in case of failure. I am wondering about the benefit for the user reading through the logs. Maybe the log was only there, because UMH upcall client tracking operations were something new?
Kind regards,
Paul
Quoted 29 lines · Paul Menzel
Dear Linux folks,
Am 12.03.21 um 12:28 schrieb Paul Menzel:
Quoted 25 lines
By default, using
printk(), Linux logs messages with level warning, which leaves the user seeingNFSD: Using UMH upcall client tracking operations.
what to do about it. Reading
nfsd4_umh_cltrack_init(), the message is actually logged on success, so nothing needs to be done, and the info level should be used.Signed-off-by Paul Menzel <[email protected]>--- fs/nfsd/nfs4recover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/nfsd/nfs4recover.c +1
-1@@ -1864,7 +1864,7 @@ nfsd4_umh_cltrack_init(struct net *net) ret =nfsd4_umh_cltrack_upcall ("init" ,NULL , grace_start,NULL );kfree (grace_start);if (!ret) -printk ("NFSD: Using UMH upcall client tracking operations.\n" ); +pr_info ("NFSD: Using UMH upcall client tracking operations.\n" );
Quoted 8 lines
fs/nfsd/nfs4recover.c nfsd4_umh_cltrack_init(struct net *net) · line 1869
Quoted 2 lines
fs/nfsd/nfs4recover.c +0
-0return ret; }A debug-level message could also be used, or the line totally removed, and the condition be changed to print an error in case of failure. I am wondering about the benefit for the user reading through the logs. Maybe the log was only there, because UMH upcall client tracking operations were something new?
Could be.
I think debug-level would be fine.
--b.
PATCH v2 1/1 nfsd: Log error on UMH upcall init failure and debug message on success
By default, using printk(), Linux logs messages with level warning, which leaves the user reading
NFSD: Using UMH upcall client tracking operations.
wondering what to do about it. Reading nfsd4_umh_cltrack_init(), the message is actually logged on success, so nothing needs to be done, and it was decided to use the debug level.
Additionally, Linux now logs an error on init failure.
NFSD: Failed to init UMH upcall client tracking operations.
--- fs/nfsd/nfs4recover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfs4recover.c +1 -1
@@ -1864,7 +1864,7 @@ nfsd4_umh_cltrack_init(struct net *net) ret =nfsd4_umh_cltrack_upcall ("init" ,NULL , grace_start,NULL );kfree (grace_start);if (!ret) -printk ("NFSD: Using UMH upcall client tracking operations.\n" ); +pr_info ("NFSD: Using UMH upcall client tracking operations.\n" );return ret; }
Signature · 1 line
2.30.2
PATCH v3 1/1 nfsd: Log error on UMH upcall init failure and debug message on success
By default, using printk(), Linux logs messages with level warning, which leaves the user reading
NFSD: Using UMH upcall client tracking operations.
wondering what to do about it. Reading nfsd4_umh_cltrack_init(), the message is actually logged on success, so nothing needs to be done, and it was decided to use the debug level.
Additionally, Linux now logs an error on init failure.
NFSD: Failed to init UMH upcall client tracking operations.
---
v2: Log error and demote success message to debug-level (forgot -a in git commit --amend)
v3: Actually sent correct diff
fs/nfsd/nfs4recover.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/nfsd/nfs4recover.c +5 -2
@@ -1863,8 +1863,11 @@ nfsd4_umh_cltrack_init(struct net *net) ret =nfsd4_umh_cltrack_upcall ("init" ,NULL , grace_start,NULL );kfree (grace_start); -if (!ret) -printk ("NFSD: Using UMH upcall client tracking operations.\n" ); +if (ret) +pr_debug ("NFSD: Using UMH upcall client tracking operations.\n" ); +else +pr_err ("NFSD: Failed to init UMH upcall client tracking operations." ); +return ret; }
Signature · 1 line
2.30.2
Re: [PATCH v3] nfsd: Log error on UMH upcall init failure and debug message on success
Quoted 5 lines · Paul Menzel
By default, using
printk(), Linux logs messages with level warning, which leaves the user readingNFSD: Using UMH upcall client tracking operations.
Quoted 7 lines
wondering what to do about it. Reading
nfsd4_umh_cltrack_init(), the message is actually logged on success, so nothing needs to be done, and it was decided to use the debug level.Additionally, Linux now logs an error on init failure.
NFSD: Failed to init UMH upcall client tracking operations.
The thing is, it's actually trying a series of different mechanisms (see nfsd4_client_tracking_init) and taking the first one that works. It's more useful to see which one of them ends up being chosen rather than the list of mechanisms that failed. (And those failures are normal if userland is configured to use something lower down in the list.)
So, let's just demote to "debug" and leave the logic otherwise unchanged.
--b.
Quoted 30 lines
Signed-off-by Paul Menzel <[email protected]>---
v2: Log error and demote success message to debug-level (forgot-aingit commit --amend)
v3: Actually sent correct difffs/nfsd/nfs4recover.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)fs/nfsd/nfs4recover.c +5
-2@@ -1863,8 +1863,11 @@ nfsd4_umh_cltrack_init(struct net *net) ret =nfsd4_umh_cltrack_upcall ("init" ,NULL , grace_start,NULL );kfree (grace_start); -if (!ret) -printk ("NFSD: Using UMH upcall client tracking operations.\n" ); +if (ret) +pr_debug ("NFSD: Using UMH upcall client tracking operations.\n" ); +else +pr_err ("NFSD: Failed to init UMH upcall client tracking operations." ); +return ret; }Signature · 1 line
2.30.2
PATCH v4 1/1 nfsd: Log client tracking type log message as info instead of warning
printk(), by default, uses the log level warning, which leaves the user reading
NFSD: Using UMH upcall client tracking operations.
wondering what to do about it (dmesg --level=warn).
Several client tracking methods are tried, and expected to fail. That’s why a message is printed only on success. It might be interesting for users to know the chosen method, so use info-level instead of debug-level.
---
v4: Remove error message, and use info-level, as several client tracking methods are tried.
fs/nfsd/nfs4recover.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/nfsd/nfs4recover.c +4 -4
@@ -626,7 +626,7 @@ nfsd4_legacy_tracking_init(struct net *net) status =nfsd4_load_reboot_recovery_data (net);if (status) goto err; -printk ("NFSD: Using legacy client tracking operations.\n" ); +pr_info ("NFSD: Using legacy client tracking operations.\n" );return 0 ; err:
@@ -1028,7 +1028,7 @@ nfsd4_init_cld_pipe(struct net *net) status =__nfsd4_init_cld_pipe (net);if (!status) -printk ("NFSD: Using old nfsdcld client tracking operations.\n" ); +pr_info ("NFSD: Using old nfsdcld client tracking operations.\n" );return status; }
@@ -1605,7 +1605,7 @@ nfsd4_cld_tracking_init(struct net *net)nfs4_release_reclaim (nn); goto err_remove; }else -printk ("NFSD: Using nfsdcld client tracking operations.\n" ); +pr_info ("NFSD: Using nfsdcld client tracking operations.\n" );return 0 ; err_remove:
@@ -1864,7 +1864,7 @@ nfsd4_umh_cltrack_init(struct net *net) ret =nfsd4_umh_cltrack_upcall ("init" ,NULL , grace_start,NULL );kfree (grace_start);if (!ret) -printk ("NFSD: Using UMH upcall client tracking operations.\n" ); +pr_info ("NFSD: Using UMH upcall client tracking operations.\n" );return ret; }
Signature · 1 line
2.30.2
Re: [PATCH v4] nfsd: Log client tracking type log message as info instead of warning
Quoted 11 lines · Paul Menzel
printk(), by default, uses the log level warning, which leaves the user readingNFSD: Using UMH upcall client tracking operations.
wondering what to do about it (
dmesg --level=warn).
Quoted 7 lines
Several client tracking methods are tried, and expected to fail. That’s why a message is printed only on success. It might be interesting for users to know the chosen method, so use info-level instead of debug-level.
Signed-off-by Paul Menzel <[email protected]>
Hi Paul, I've included your patch in the for-next topic branch at
git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git
Quoted 50 lines
---
v4: Remove error message, and use info-level, as several client tracking methods are tried.
fs/nfsd/nfs4recover.c| 8 ++++----1 file changed, 4 insertions(+), 4 deletions(-)fs/nfsd/nfs4recover.c +1
-1@@ -626,7 +626,7 @@ nfsd4_legacy_tracking_init(struct net *net) status =nfsd4_load_reboot_recovery_data (net);if (status) goto err; -printk ("NFSD: Using legacy client tracking operations.\n" ); +pr_info ("NFSD: Using legacy client tracking operations.\n" );return 0 ;err:
fs/nfsd/nfs4recover.c +2
-2@@ -1028,7 +1028,7 @@ nfsd4_init_cld_pipe(struct net *net) status =__nfsd4_init_cld_pipe (net);if (!status) -printk ("NFSD: Using old nfsdcld client tracking operations.\n" ); +pr_info ("NFSD: Using old nfsdcld client tracking operations.\n" );return status; }@@ -1605,7 +1605,7 @@ nfsd4_cld_tracking_init(struct net *net)nfs4_release_reclaim (nn); goto err_remove; }else -printk ("NFSD: Using nfsdcld client tracking operations.\n" ); +pr_info ("NFSD: Using nfsdcld client tracking operations.\n" );return 0 ;
err_remove:fs/nfsd/nfs4recover.c +1
-1@@ -1864,7 +1864,7 @@ nfsd4_umh_cltrack_init(struct net *net) ret =nfsd4_umh_cltrack_upcall ("init" ,NULL , grace_start,NULL );kfree (grace_start);if (!ret) -printk ("NFSD: Using UMH upcall client tracking operations.\n" ); +pr_info ("NFSD: Using UMH upcall client tracking operations.\n" );return ret; }Signature · 1 line
2.30.2
--
Chuck Lever
Re: [PATCH v3] nfsd: Log error on UMH upcall init failure and debug message on success
In reply to Paul MenzelHi Paul-
Quoted 29 lines · Paul Menzel
By default, using
printk(), Linux logs messages with level warning, which leaves the user readingNFSD: Using UMH upcall client tracking operations.
wondering what to do about it. Reading
nfsd4_umh_cltrack_init(), the message is actually logged on success, so nothing needs to be done, and it was decided to use the debug level.Additionally, Linux now logs an error on init failure.
NFSD: Failed to init UMH upcall client tracking operations.
Signed-off-by Paul Menzel <[email protected]>---
v2: Log error and demote success message to debug-level (forgot-aingit commit --amend)
v3: Actually sent correct diff
fs/nfsd/nfs4recover.c| 7 +++++--1 file changed, 5 insertions(+), 2 deletions(-)fs/nfsd/nfs4recover.c +0
-0
fs/nfsd/nfs4recover.c nfsd4_umh_cltrack_init(struct net *net) · line 1867
Quoted 7 lines
fs/nfsd/nfs4recover.c +2
-2@@ -1863,8 +1863,11 @@ nfsd4_umh_cltrack_init(struct net *net) ret =nfsd4_umh_cltrack_upcall ("init" ,NULL , grace_start,NULL );kfree (grace_start); -if (!ret) -printk ("NFSD: Using UMH upcall client tracking operations.\n" ); +if (ret) +pr_debug ("NFSD: Using UMH upcall client tracking operations.\n" );
Looking back at 869216075b63 ("nfsd: re-order client tracking method selection"), the idea here seems to be that only one of the "Using yada upcall client" is supposed to fire. If an error occurs here, there is a fallback. No additional error need be reported, IMHO.
So the printk() call-sites added by 869216075b63 all need to be adjusted to use pr_info(), I think?
Quoted 9 lines
fs/nfsd/nfs4recover.c +3
-0+else +pr_err ("NFSD: Failed to init UMH upcall client tracking operations." ); +return ret; }Signature · 1 line
2.30.2
--
Chuck Lever