aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-07-30 17:40:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 20:25:14 -0400
commit088a52aac810655c1db1e40331e4936946701e9c (patch)
tree51ad8938a70c0bd3a08c74379dbec3107037d602 /kernel/printk.c
parent04d2c8c83d0e3ac5f78aeede51babb3236200112 (diff)
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: Joe Perches <joe@perches.com> Cc: Kay Sievers <kay@vrfy.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 0d882a2f231e..6a76ab9d4476 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1487,7 +1487,6 @@ asmlinkage int vprintk_emit(int facility, int level,
1487 size_t text_len; 1487 size_t text_len;
1488 enum log_flags lflags = 0; 1488 enum log_flags lflags = 0;
1489 unsigned long flags; 1489 unsigned long flags;
1490 int kern_level;
1491 int this_cpu; 1490 int this_cpu;
1492 int printed_len = 0; 1491 int printed_len = 0;
1493 1492
@@ -1543,21 +1542,24 @@ asmlinkage int vprintk_emit(int facility, int level,
1543 lflags |= LOG_NEWLINE; 1542 lflags |= LOG_NEWLINE;
1544 } 1543 }
1545 1544
1546 /* strip syslog prefix and extract log level or control flags */ 1545 /* strip kernel syslog prefix and extract log level or control flags */
1547 kern_level = printk_get_level(text); 1546 if (facility == 0) {
1548 if (kern_level) { 1547 int kern_level = printk_get_level(text);
1549 const char *end_of_header = printk_skip_level(text); 1548
1550 switch (kern_level) { 1549 if (kern_level) {
1551 case '0' ... '7': 1550 const char *end_of_header = printk_skip_level(text);
1552 if (level == -1) 1551 switch (kern_level) {
1553 level = kern_level - '0'; 1552 case '0' ... '7':
1554 case 'd': /* KERN_DEFAULT */ 1553 if (level == -1)
1555 lflags |= LOG_PREFIX; 1554 level = kern_level - '0';
1556 case 'c': /* KERN_CONT */ 1555 case 'd': /* KERN_DEFAULT */
1557 break; 1556 lflags |= LOG_PREFIX;
1557 case 'c': /* KERN_CONT */
1558 break;
1559 }
1560 text_len -= end_of_header - text;
1561 text = (char *)end_of_header;
1558 } 1562 }
1559 text_len -= end_of_header - text;
1560 text = (char *)end_of_header;
1561 } 1563 }
1562 1564
1563 if (level == -1) 1565 if (level == -1)