From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Joe Perches <joe@perches.com>,
Andrew Morton <akpm@linux-foundation.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Jason Wessel <jason.wessel@windriver.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
David Sterba <dsterba@suse.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/4] printk/NMI: Handle continuous lines and missing newline
Date: Fri, 11 Nov 2016 09:26:35 +0900 [thread overview]
Message-ID: <20161111002635.GA4682@swordfish> (raw)
In-Reply-To: <1478695291-12169-2-git-send-email-pmladek@suse.com>
On (11/09/16 13:41), Petr Mladek wrote:
> The commit 4bcc595ccd80decb4245 ("printk: reinstate KERN_CONT for printing
> continuation lines") added back KERN_CONT message header. As a result
> it might appear in the middle of the line when the parts are squashed
> via the temporary NMI buffer.
>
> A reasonable solution seems to be to split the text in the NNI temporary
> not only by newlines but also by the message headers.
>
> Another solution would be to filter out KERN_CONT when writing to
> the temporary buffer. But this would complicate the lockless handling.
> Also it would not solve problems with a missing newline that was there
> even before the KERN_CONT stuff.
>
> This patch moves the temporary buffer handling into separate function.
> I played with it and it seems that using the char pointers make the
> code easier to read.
>
> Also it prints the final newline as a continuous line.
>
> Finally, it moves handling of the s->len overflow into the paranoid check.
> And allows to recover from the disaster.
>
> Signed-off-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
without the patch I see prefixes (^Ac) in WARN_ON() output from NMI:
[ 0.895911] ------------[ cut here ]------------
[ 0.895966] WARNING: CPU: 0 PID: 1 at kernel/[..]
[ 0.896026] Modules linked in:^Ac
^^^^
[..]
[ 0.896705] RSP: 0000:ffffc900000176c0 EFLAGS: 00000296^Ac
^^^^^
-ss
next prev parent reply other threads:[~2016-11-11 0:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 12:41 [PATCH v2 0/4] printk: Fixes and hardening related to KERN_CONT Petr Mladek
2016-11-09 12:41 ` [PATCH v2 1/4] printk/NMI: Handle continuous lines and missing newline Petr Mladek
2016-11-11 0:26 ` Sergey Senozhatsky [this message]
2016-11-11 17:28 ` Steven Rostedt
2016-11-11 18:07 ` Petr Mladek
2016-11-09 12:41 ` [PATCH v2 2/4] printk/kdb: Handle more message headers Petr Mladek
2016-11-11 17:35 ` Steven Rostedt
2016-11-11 18:13 ` Petr Mladek
2016-11-09 12:41 ` [PATCH v2 3/4] printk/btrfs: " Petr Mladek
2016-11-10 13:20 ` David Sterba
2016-11-11 17:41 ` Steven Rostedt
2016-11-11 18:16 ` Petr Mladek
2016-12-13 9:21 ` Geert Uytterhoeven
2016-12-13 13:52 ` Petr Mladek
2016-12-13 14:01 ` Geert Uytterhoeven
2016-12-13 14:26 ` David Sterba
2016-11-09 12:41 ` [PATCH v2 4/4] printk/sound: " Petr Mladek
2016-11-11 17:54 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161111002635.GA4682@swordfish \
--to=sergey.senozhatsky.work@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=jason.wessel@windriver.com \
--cc=jbacik@fb.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=tiwai@suse.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).