提交 088a52aa 编写于 作者: J Joe Perches 提交者: Linus Torvalds

printk: only look for prefix levels in kernel messages

vprintk_emit() prefix parsing should only be done for internal kernel
messages.  This allows existing behavior to be kept in all cases.
Signed-off-by: NJoe Perches <joe@perches.com>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 04d2c8c8
......@@ -1487,7 +1487,6 @@ asmlinkage int vprintk_emit(int facility, int level,
size_t text_len;
enum log_flags lflags = 0;
unsigned long flags;
int kern_level;
int this_cpu;
int printed_len = 0;
......@@ -1543,8 +1542,10 @@ asmlinkage int vprintk_emit(int facility, int level,
lflags |= LOG_NEWLINE;
}
/* strip syslog prefix and extract log level or control flags */
kern_level = printk_get_level(text);
/* strip kernel syslog prefix and extract log level or control flags */
if (facility == 0) {
int kern_level = printk_get_level(text);
if (kern_level) {
const char *end_of_header = printk_skip_level(text);
switch (kern_level) {
......@@ -1559,6 +1560,7 @@ asmlinkage int vprintk_emit(int facility, int level,
text_len -= end_of_header - text;
text = (char *)end_of_header;
}
}
if (level == -1)
level = default_message_loglevel;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册