Skip to content

Commit d2e85ca

Browse files
jognesspmladek
authored andcommitted
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]>
1 parent 8ba7771 commit d2e85ca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/printk/printk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,6 +3269,9 @@ void console_flush_on_panic(enum con_flush_mode mode)
32693269
if (mode == CONSOLE_REPLAY_ALL)
32703270
__console_rewind_all();
32713271

3272+
if (!have_boot_console)
3273+
nbcon_atomic_flush_pending();
3274+
32723275
console_flush_all(false, &next_seq, &handover);
32733276
}
32743277

0 commit comments

Comments
 (0)