lkml.org 
[lkml]   [2018]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 4.19 regression fix] printk: For early boot messages check loglevel when flushing the buffer
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

\
 
 \ /
  Last update: 2018-09-05 10:34    [W:0.081 / U:0.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site