Messages in this thread Patch in this message | | | From | Schspa Shi <> | Subject | [PATCH 5.10-rt] printk: fix suppressed message print when reboot/panic | Date | Mon, 21 Mar 2022 13:38:16 +0800 |
| |
Update printk_seq for suppressed message.
Affects 5.9-rt and 5.10-rt
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").
Signed-off-by: Schspa Shi <schspa@gmail.com> --- kernel/printk/printk.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 0c56873396a9..f68c4ba7eb4d 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2826,8 +2826,17 @@ static int printk_kthread_func(void *data) if (!(con->flags & CON_ENABLED)) continue; - if (suppress_message_printing(r.info->level)) + printk_seq = atomic64_read(&con->printk_seq); + + if (suppress_message_printing(r.info->level)) { + /* + * Skip record we have buffered and already printed + * directly to the console when we received it, and + * record that has level above the console loglevel. + */ + atomic64_cmpxchg_relaxed(&con->printk_seq, printk_seq, seq); continue; + } if (con->flags & CON_EXTENDED) { len = info_print_ext_header(ext_text, @@ -2843,7 +2852,6 @@ static int printk_kthread_func(void *data) printk_time); } - printk_seq = atomic64_read(&con->printk_seq); console_lock(); console_may_schedule = 0; -- 2.29.0
| |