Skip to contentSkip to conversation

printk: fix suppressed message print when reboot/panic

PATCH In review Schspa Shi 2 participants 2 messages Mar 21, 2022 Printk

lore
Share & tools
lore

Schspa Shi

author
#0 lore raw

PATCH 1/1 printk: fix suppressed message print when reboot/panic

Update printk_seq for suppressed message.

When message is suppressed, printk_seq should be updated, otherwise this message will be printed when reboot. This problem was introduced in commit 3edc0c85d154 ("printk: Rebase on top of new ring buffer").

This patch apply fix to 5.15-rt according to
Message-ID: <[email protected]>

---
 kernel/printk/printk.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
kernel/printk/printk.c +5 -1
index 0cc8e8acf545..c3e245c95de4 100644
@@ -2255,8 +2255,12 @@ static int printk_kthread_func(void *data)
 		if (!(con->flags & CON_ENABLED))
 			continue;
 
-		if (suppress_message_printing(r.info->level))
+		if (suppress_message_printing(r.info->level)) {
+			console_lock();
+			latched_seq_write(&con->printk_seq, seq);
+			console_unlock();
 			continue;
+		}
 
 		if (con->flags & CON_EXTENDED) {
 			len = info_print_ext_header(ext_text,
Signature · 1 line
2.29.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Schspa Shi

Update printk_seq for suppressed message.

When message is suppressed, printk_seq should be updated, otherwise this message will be printed when reboot. This problem was introduced in commit 3edc0c85d154 ("printk: Rebase on top of new ring buffer").

This patch apply fix to 5.15-rt according to
Message-ID: <[email protected]>

Thanks.