aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ogness <[email protected]>2024-08-20 08:35:51 +0206
committerPetr Mladek <[email protected]>2024-08-21 14:56:24 +0200
commitd2e85ca7a736d2d889bac9aef6ede0a67f6870b2 (patch)
tree85a6039eb2208825135d0c50af27569b327676d6
parent8ba77712a7501ca941603d6d5ed650cd0d42cafb (diff)
printk: Flush nbcon consoles first on panic
In console_flush_on_panic(), flush the nbcon consoles before flushing legacy consoles. The legacy write() callbacks are not fully safe when oops_in_progress is set. Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
-rw-r--r--kernel/printk/printk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 7c9f8f6e1738..c6e633329e4d 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3269,6 +3269,9 @@ void console_flush_on_panic(enum con_flush_mode mode)
if (mode == CONSOLE_REPLAY_ALL)
__console_rewind_all();
+ if (!have_boot_console)
+ nbcon_atomic_flush_pending();
+
console_flush_all(false, &next_seq, &handover);
}