summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-01-29 14:53:23 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-01-29 14:53:23 -0800
commita4fe2b4d87c9f2298ae6a641a7a64bc941d079d0 (patch)
tree25d77176e0b4fb9985212e488ac8bda355c4fc8b /kernel
parent3893c2025fec6f0fa4b2d794f36bd56a55e46dec (diff)
parentdef97da136515cb289a14729292c193e0a93bc64 (diff)
downloadlinux-a4fe2b4d87c9f2298ae6a641a7a64bc941d079d0.tar.bz2
Merge tag 'printk-for-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk
Pull printk update from Petr Mladek: "Prevent replaying log on all consoles" * tag 'printk-for-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk: printk: fix exclusive_console replaying
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk/printk.c4
1 files 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();