]> Git Repo - J-linux.git/commitdiff
printk: finalize records with trailing newlines
authorJohn Ogness <[email protected]>
Thu, 26 Nov 2020 11:48:36 +0000 (12:54 +0106)
committerPetr Mladek <[email protected]>
Fri, 27 Nov 2020 10:58:54 +0000 (11:58 +0100)
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")
Link: https://lore.kernel.org/r/[email protected]
Reported-by: Kefeng Wang <[email protected]>
Signed-off-by: John Ogness <[email protected]>
Tested-by: Kefeng Wang <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Signed-off-by: Petr Mladek <[email protected]>
kernel/printk/printk.c

index fe64a49344bf5231fbc80fc8f8a26d714accbe07..bc1e3b5a97bddba138c5c6033ed530be0e8a2e9b 100644 (file)
@@ -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);
This page took 0.054374 seconds and 4 git commands to generate.