Re: [PATCH 4.19 regression fix] printk: For early boot messages check loglevel when flushing the buffer
From: Sergey Senozhatsky
Date: Wed Sep 05 2018 - 04:33:34 EST
On (09/05/18 14:36), Sergey Senozhatsky wrote:
>
> Just a demonstration of the idea. It does not look very good, tho.
> I'd rather have just one suppress_message_printing() in printk code.
>
> // This is not a proposed patch, hence the 80-cols violation.
>
> ---
>
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index c036f128cdc3..231ac18423e1 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -2416,7 +2416,7 @@ void console_unlock(void)
> break;
>
> msg = log_from_idx(console_idx);
> - if (msg->flags & LOG_NOCONS) {
> + if (msg->flags & LOG_NOCONS || (exclusive_console && suppress_message_printing(msg->level))) {
> /*
> * Skip record if !ignore_loglevel, and
> * record has level above the console loglevel.
D'oh... Sorry about that, but, believe it or not, this is completely
not what I had in my mind. What I had, was something like this:
---
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index c036f128cdc3..dadb8c11b0d6 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2416,6 +2416,11 @@ void console_unlock(void)
break;
msg = log_from_idx(console_idx);
+
+ if (exclusive_console &&
+ !suppress_message_printing(msg->level))
+ msg->flags &= ~LOG_NOCONS;
+
if (msg->flags & LOG_NOCONS) {
/*
* Skip record if !ignore_loglevel, and
---
-ss