[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53ab7746-5871-992b-7ab8-853b7c08ae13@huawei.com>
Date: Thu, 26 Nov 2020 20:32:18 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: John Ogness <john.ogness@...utronix.de>,
Petr Mladek <pmladek@...e.com>
CC: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
"Linus Torvalds" <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Atish Patra <atishp@...shpatra.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] printk: finalize records with trailing newlines
On 2020/11/26 19:48, John Ogness wrote:
> Any record with a trailing newline (LOG_NEWLINE flag) cannot
> be continued because the newline has been stripped and will
> not be visible if the message is appended. This was already
> handled correctly when committing in log_output() but was
> not handled correctly when committing in log_store().
>
> Fixes: f5f022e53b87 ("printk: reimplement log_cont using record extension")
> Signed-off-by: John Ogness <john.ogness@...utronix.de>
> ---
> This is an important bugfix for continuous messages and should
> be part of the 5.10 release.
>
> If not applied, newlines will vanish when concatenating
> continuous with trailing newlines.
Thanks for you quick fix.
Reported-and-tested-by: Kefeng Wang <wangkefeng.wang@...wei.com>
> kernel/printk/printk.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index fe64a49344bf..bc1e3b5a97bd 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -528,8 +528,8 @@ static int log_store(u32 caller_id, int facility, int level,
> if (dev_info)
> memcpy(&r.info->dev_info, dev_info, sizeof(r.info->dev_info));
>
> - /* insert message */
> - if ((flags & LOG_CONT) || !(flags & LOG_NEWLINE))
> + /* A message without a trailing newline can be continued. */
> + if (!(flags & LOG_NEWLINE))
> prb_commit(&e);
> else
> prb_final_commit(&e);
Powered by blists - more mailing lists