Skip to content

Commit def97da

Browse files
jognesspmladek
authored andcommitted
printk: fix exclusive_console replaying
Commit f92b070 ("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: f92b070 ("printk: Do not miss new messages when replaying the log") Link: http://lkml.kernel.org/r/[email protected] Cc: Steven Rostedt <[email protected]> Cc: [email protected] Signed-off-by: John Ogness <[email protected]> Acked-by: Sergey Senozhatsky <[email protected]> Signed-off-by: Petr Mladek <[email protected]>
1 parent 184b8f7 commit def97da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/printk/printk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,8 +2770,6 @@ void register_console(struct console *newcon)
27702770
* for us.
27712771
*/
27722772
logbuf_lock_irqsave(flags);
2773-
console_seq = syslog_seq;
2774-
console_idx = syslog_idx;
27752773
/*
27762774
* We're about to replay the log buffer. Only do this to the
27772775
* just-registered console to avoid excessive message spam to
@@ -2783,6 +2781,8 @@ void register_console(struct console *newcon)
27832781
*/
27842782
exclusive_console = newcon;
27852783
exclusive_console_stop_seq = console_seq;
2784+
console_seq = syslog_seq;
2785+
console_idx = syslog_idx;
27862786
logbuf_unlock_irqrestore(flags);
27872787
}
27882788
console_unlock();

0 commit comments

Comments
 (0)