forked from luck/tmp_suning_uos_patched
printk: finalize records with trailing newlines
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: f5f022e53b
("printk: reimplement log_cont using record extension")
Link: https://lore.kernel.org/r/20201126114836.14750-1-john.ogness@linutronix.de
Reported-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
This commit is contained in:
parent
8119c4332d
commit
4ad9921af4
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user