* [PATCH] printk: fix exclusive_console replaying
@ 2019-12-19 11:53 John Ogness
2019-12-19 14:22 ` Petr Mladek
2019-12-23 0:18 ` Sergey Senozhatsky
0 siblings, 2 replies; 4+ messages in thread
From: John Ogness @ 2019-12-19 11:53 UTC (permalink / raw)
To: Petr Mladek; +Cc: Sergey Senozhatsky, Steven Rostedt, linux-kernel
Commit f92b070f2dc8 ("printk: Do not miss new messages when replaying
the log") introduced a new variable @exclusive_console_stop_seq to
store when an exclusive console should stop printing. It should be
set to the @console_seq value at registration. However, @console_seq
is previously set to @syslog_seq so that the exclusive console knows
where to begin. This results in the exclusive console immediately
reactivating all the other consoles and thus repeating the messages
for those consoles.
Set @console_seq after @exclusive_console_stop_seq has stored the
current @console_seq value.
Fixes: f92b070f2dc8 ("printk: Do not miss new messages when replaying the log")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
kernel/printk/printk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 1ef6f75d92f1..fada22dc4ab6 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2770,8 +2770,6 @@ void register_console(struct console *newcon)
* for us.
*/
logbuf_lock_irqsave(flags);
- console_seq = syslog_seq;
- console_idx = syslog_idx;
/*
* We're about to replay the log buffer. Only do this to the
* just-registered console to avoid excessive message spam to
@@ -2783,6 +2781,8 @@ void register_console(struct console *newcon)
*/
exclusive_console = newcon;
exclusive_console_stop_seq = console_seq;
+ console_seq = syslog_seq;
+ console_idx = syslog_idx;
logbuf_unlock_irqrestore(flags);
}
console_unlock();
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] printk: fix exclusive_console replaying
2019-12-19 11:53 [PATCH] printk: fix exclusive_console replaying John Ogness
@ 2019-12-19 14:22 ` Petr Mladek
2019-12-23 0:18 ` Sergey Senozhatsky
1 sibling, 0 replies; 4+ messages in thread
From: Petr Mladek @ 2019-12-19 14:22 UTC (permalink / raw)
To: John Ogness; +Cc: Sergey Senozhatsky, Steven Rostedt, linux-kernel
On Thu 2019-12-19 12:59:22, John Ogness wrote:
> Commit f92b070f2dc8 ("printk: Do not miss new messages when replaying
> the log") introduced a new variable @exclusive_console_stop_seq to
> store when an exclusive console should stop printing. It should be
> set to the @console_seq value at registration. However, @console_seq
> is previously set to @syslog_seq so that the exclusive console knows
> where to begin. This results in the exclusive console immediately
> reactivating all the other consoles and thus repeating the messages
> for those consoles.
>
> Set @console_seq after @exclusive_console_stop_seq has stored the
> current @console_seq value.
>
> Fixes: f92b070f2dc8 ("printk: Do not miss new messages when replaying the log")
> Signed-off-by: John Ogness <john.ogness@linutronix.de>
Grr, it was an ugly mistake. I am surprised that it has stayed there
for more then one year without noticing. Thanks a lot for fixing.
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] printk: fix exclusive_console replaying
2019-12-19 11:53 [PATCH] printk: fix exclusive_console replaying John Ogness
2019-12-19 14:22 ` Petr Mladek
@ 2019-12-23 0:18 ` Sergey Senozhatsky
2020-01-02 15:35 ` Petr Mladek
1 sibling, 1 reply; 4+ messages in thread
From: Sergey Senozhatsky @ 2019-12-23 0:18 UTC (permalink / raw)
To: John Ogness; +Cc: Petr Mladek, Sergey Senozhatsky, Steven Rostedt, linux-kernel
On (19/12/19 12:59), John Ogness wrote:
> Commit f92b070f2dc8 ("printk: Do not miss new messages when replaying
> the log") introduced a new variable @exclusive_console_stop_seq to
> store when an exclusive console should stop printing. It should be
> set to the @console_seq value at registration. However, @console_seq
> is previously set to @syslog_seq so that the exclusive console knows
> where to begin. This results in the exclusive console immediately
> reactivating all the other consoles and thus repeating the messages
> for those consoles.
>
> Set @console_seq after @exclusive_console_stop_seq has stored the
> current @console_seq value.
>
> Fixes: f92b070f2dc8 ("printk: Do not miss new messages when replaying the log")
> Signed-off-by: John Ogness <john.ogness@linutronix.de>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Thanks!
-ss
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] printk: fix exclusive_console replaying
2019-12-23 0:18 ` Sergey Senozhatsky
@ 2020-01-02 15:35 ` Petr Mladek
0 siblings, 0 replies; 4+ messages in thread
From: Petr Mladek @ 2020-01-02 15:35 UTC (permalink / raw)
To: Sergey Senozhatsky
Cc: John Ogness, Sergey Senozhatsky, Steven Rostedt, linux-kernel
On Mon 2019-12-23 09:18:01, Sergey Senozhatsky wrote:
> On (19/12/19 12:59), John Ogness wrote:
> > Commit f92b070f2dc8 ("printk: Do not miss new messages when replaying
> > the log") introduced a new variable @exclusive_console_stop_seq to
> > store when an exclusive console should stop printing. It should be
> > set to the @console_seq value at registration. However, @console_seq
> > is previously set to @syslog_seq so that the exclusive console knows
> > where to begin. This results in the exclusive console immediately
> > reactivating all the other consoles and thus repeating the messages
> > for those consoles.
> >
> > Set @console_seq after @exclusive_console_stop_seq has stored the
> > current @console_seq value.
> >
> > Fixes: f92b070f2dc8 ("printk: Do not miss new messages when replaying the log")
> > Signed-off-by: John Ogness <john.ogness@linutronix.de>
>
> Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
The patch has been commited into printk.git, branch for-5.6.
Best Regards,
Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-02 15:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 11:53 [PATCH] printk: fix exclusive_console replaying John Ogness
2019-12-19 14:22 ` Petr Mladek
2019-12-23 0:18 ` Sergey Senozhatsky
2020-01-02 15:35 ` Petr Mladek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).