Skip to contentSkip to conversation

smb: client: transport: Fix debug printing in __release_mid()

PATCH Applied Andy Shevchenko 3 participants 4 messages Aug 25 – Aug 27

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

PATCH 1/1 smb: client: transport: Fix debug printing in __release_mid()

Long time ago during upgrading printk():s to the respective pr_<level>() calls one misconversion happened and nobody has noticed that. So, previously printk(KERN_DEBUG) + printk() worked as one long debug print since the trailing '\n' is only present in the followup printk() format string. The culprit change missed that and split the message to two on the different levels. Restore the original behaviour to make users be less confused in the most likely never happen cases of partially getting that message.

Fixes 0b456f04bcdf ("cifs: convert printk(LEVEL...) to pr_<level>")
---
 fs/smb/client/transport.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
fs/smb/client/transport.c +5 -6
index fdf4e50c27ce..e266859818a4 100644
@@ -101,12 +101,11 @@ void __release_mid(struct TCP_Server_Info *server, struct mid_q_entry *midEntry)
 		trace_smb3_slow_rsp(smb_cmd, midEntry->mid, midEntry->pid,
 			       midEntry->when_sent, midEntry->when_received);
 		if (cifsFYI & CIFS_TIMER) {
-			pr_debug("slow rsp: cmd %d mid %llu",
-				 midEntry->command, midEntry->mid);
-			cifs_info("A: 0x%lx S: 0x%lx R: 0x%lx\n",
-				  now - midEntry->when_alloc,
-				  now - midEntry->when_sent,
-				  now - midEntry->when_received);
+			pr_debug("slow rsp: cmd %d mid %llu A: 0x%lx S: 0x%lx R: 0x%lx\n",
+				 midEntry->command, midEntry->mid,
+				 now - midEntry->when_alloc,
+				 now - midEntry->when_sent,
+				 now - midEntry->when_received);
 		}
 	}
 #endif
Signature · 1 line
2.50.1
#1 lore raw

Hi Andy,

Quoted 21 lines · On Tue, 25 Aug 2026 10:30:43 +0200 Andy Shevchenko…

Long time ago during upgrading printk():s to the respective pr_<level>() calls one misconversion happened and nobody has noticed that. So, previously printk(KERN_DEBUG) + printk() worked as one long debug print since the trailing '\n' is only present in the followup printk() format string. The culprit change missed that and split the message to two on the different levels. Restore the original behaviour to make users be less confused in the most likely never happen cases of partially getting that message.

Fixes 0b456f04bcdf ("cifs: convert printk(LEVEL...) to pr_<level>")
---
 fs/smb/client/transport.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
fs/smb/client/transport.c +0 -0
index fdf4e50c27ce..e266859818a4 100644
@@ -101,12 +101,11 @@ void __release_mid(struct TCP_Server_Info *server, struct mid_q_entry *midEntry)
 		trace_smb3_slow_rsp(smb_cmd, midEntry->mid, midEntry->pid,

fs/smb/client/transport.c void __release_mid(struct TCP_Server_Info *server, struct mid_q_entry *midEntry) · line 105

Quoted 10 lines
fs/smb/client/transport.c +2 -6
 			       midEntry->when_sent, midEntry->when_received);
 		if (cifsFYI & CIFS_TIMER) {
-			pr_debug("slow rsp: cmd %d mid %llu",
-				 midEntry->command, midEntry->mid);
-			cifs_info("A: 0x%lx S: 0x%lx R: 0x%lx\n",
-				  now - midEntry->when_alloc,
-				  now - midEntry->when_sent,
-				  now - midEntry->when_received);
+			pr_debug("slow rsp: cmd %d mid %llu A: 0x%lx S: 0x%lx R: 0x%lx\n",
+				 midEntry->command, midEntry->mid,

The change looks correct to me.

One minor suggestion: could the format string be split using adjacent string literals to avoid the long source line?

    pr_debug("slow rsp: cmd %d mid %llu "
             "A: 0x%lx S: 0x%lx R: 0x%lx\n",
             ...);
Quoted 10 lines
fs/smb/client/transport.c +3 -0
+				 now - midEntry->when_alloc,
+				 now - midEntry->when_sent,
+				 now - midEntry->when_received);
 		}
 	}
 #endif
Signature · 1 line
2.50.1

Thank you!

Best regards,
Yunseong

#2 lore raw
Quoted 1 line · Yunseong Kim

On Tue, 25 Aug 2026 10:30:43 +0200 Andy Shevchenko <[email protected]> wrote:

...

Quoted 9 lines

fs/smb/client/transport.c void __release_mid(struct TCP_Server_Info *server, struct mid_q_entry *midEntry) · line 105

Quoted 6 lines
fs/smb/client/transport.c +2 -4
-			cifs_info("A: 0x%lx S: 0x%lx R: 0x%lx\n",
-				  now - midEntry->when_alloc,
-				  now - midEntry->when_sent,
-				  now - midEntry->when_received);
+			pr_debug("slow rsp: cmd %d mid %llu A: 0x%lx S: 0x%lx R: 0x%lx\n",
+				 midEntry->command, midEntry->mid,

The change looks correct to me.

Quoted 6 lines

One minor suggestion: could the format string be split using adjacent string literals to avoid the long source line?

    pr_debug("slow rsp: cmd %d mid %llu "
             "A: 0x%lx S: 0x%lx R: 0x%lx\n",
             ...);

No, the idea is to have long string literals. This was exceptionally done somewhat 15+ years ago.

See f4c014c0dede ("checkpatch: allow printk strings to exceed 80 characters to maintain their searchability") as the result of the discussion started here:
https://lore.kernel.org/lkml/[email protected]/

Quoted 3 lines
Quoted 3 lines
fs/smb/client/transport.c +3 -0
+				 now - midEntry->when_alloc,
+				 now - midEntry->when_sent,
+				 now - midEntry->when_received);
Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer Applied
#3 lore raw
In reply to Andy Shevchenko
Quoted 9 lines · Andy Shevchenko

Long time ago during upgrading printk():s to the respective pr_<level>() calls one misconversion happened and nobody has noticed that. So, previously printk(KERN_DEBUG) + printk() worked as one long debug print since the trailing '\n' is only present in the followup printk() format string. The culprit change missed that and split the message to two on the different levels. Restore the original behaviour to make users be less confused in the most likely never happen cases of partially getting that message.
...

Applied.