Re: [RFC PATCH v1 16/25] printk: implement CON_PRINTBUFFER

From: Petr Mladek
Date: Tue Feb 26 2019 - 10:38:19 EST


On Tue 2019-02-12 15:29:54, John Ogness wrote:
> If the CON_PRINTBUFFER flag is not set, do not replay the history
> for that console.

This patch fixes a regression caused by previous patches.
We need to do it a way that does not cause the regression
and do not break bisection.

> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index 6c875abd7b17..b97d4195b09a 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -1596,8 +1592,12 @@ static void call_console_drivers(u64 seq, const char *ext_text, size_t ext_len,
> if (!(con->flags & CON_ENABLED))
> continue;
> if (!con->wrote_history) {
> - printk_write_history(con, seq);
> - continue;
> + if (con->flags & CON_PRINTBUFFER) {
> + printk_write_history(con, seq);
> + continue;
> + }
> + con->wrote_history = 1;

I have just got an idea that we do not need a new flag.
We could clear CON_PRINTBUFFER bit instead.

Best Regards,
Petr