Skip to contentSkip to conversation

nfsd: Demote UMH upcall init message from warning- to info-level

PATCH In review Paul Menzel 3 participants 9 messages Mar 12, 2021 – Mar 15, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 891395c6c7d3..db66c45a6b97 100644
@@ -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
#1 lore raw

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 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 +0 -0
index 891395c6c7d3..db66c45a6b97 100644

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

#2 lore raw
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 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
index 891395c6c7d3..db66c45a6b97 100644
@@ -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 -0
 	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?

Could be.

I think debug-level would be fine.

--b.

#3 lore raw

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
index 891395c6c7d3..db66c45a6b97 100644
@@ -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
#4 lore raw

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
index 891395c6c7d3..fff89c739033 100644
@@ -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
#5 lore raw

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 reading

NFSD: 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

---
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
index 891395c6c7d3..fff89c739033 100644
@@ -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
#6 lore raw

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
index 891395c6c7d3..6fedc49726bf 100644
@@ -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
#7 lore raw

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 reading

NFSD: 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.

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
index 891395c6c7d3..6fedc49726bf 100644
@@ -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

#8 lore raw

Re: [PATCH v3] nfsd: Log error on UMH upcall init failure and debug message on success

In reply to Paul Menzel

Hi Paul-

Quoted 29 lines · Paul Menzel

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 +0 -0
index 891395c6c7d3..fff89c739033 100644

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