lkml.org 
[lkml]   [2017]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: printk: what is going on with additional newlines?
On (08/28/17 21:21), Sergey Senozhatsky wrote:
> how about something like this?
>

...ok, definetely breaks the

KERN_ERR "foo"; KERN_CONT "bar"; KERN_CONT "bar"; KERN_CONT "\n";

case. um... something like this then?

---

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index fc47863f629c..098e280e9fe0 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1670,10 +1670,11 @@ static size_t log_output(int facility, int level, enum log_flags lflags, const c
* write from the same process, try to add it to the buffer.
*/
if (cont.len) {
- if (cont.owner == current && (lflags & LOG_CONT)) {
+ if (cont.owner == current &&
+ ((cont.level == level) ||
+ (lflags & LOG_CONT)))
if (cont_add(facility, level, lflags, text, text_len))
return text_len;
- }
/* Otherwise, make sure it's flushed */
cont_flush();
}

\
 
 \ /
  Last update: 2017-08-28 14:38    [W:0.287 / U:1.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site