summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-07-30 14:40:19 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 17:25:14 -0700
commit088a52aac810655c1db1e40331e4936946701e9c (patch)
tree51ad8938a70c0bd3a08c74379dbec3107037d602 /kernel
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')
-rw-r--r--kernel/printk.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 0d882a2f231..6a76ab9d447 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -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,21 +1542,24 @@ 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);
- if (kern_level) {
- const char *end_of_header = printk_skip_level(text);
- switch (kern_level) {
- case '0' ... '7':
- if (level == -1)
- level = kern_level - '0';
- case 'd': /* KERN_DEFAULT */
- lflags |= LOG_PREFIX;
- case 'c': /* KERN_CONT */
- break;
+ /* 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) {
+ case '0' ... '7':
+ if (level == -1)
+ level = kern_level - '0';
+ case 'd': /* KERN_DEFAULT */
+ lflags |= LOG_PREFIX;
+ case 'c': /* KERN_CONT */
+ break;
+ }
+ text_len -= end_of_header - text;
+ text = (char *)end_of_header;
}
- text_len -= end_of_header - text;
- text = (char *)end_of_header;
}
if (level == -1)