[PATCH 2/2] printk: Debug patch 2

From: Jan Kara
Date: Wed Jun 11 2014 - 16:38:41 EST


Signed-off-by: Jan Kara <jack@xxxxxxx>
---
kernel/printk/printk.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index da94dc18b6fa..7263c4353150 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1638,17 +1638,19 @@ asmlinkage int vprintk_emit(int facility, int level,
logbuf_cpu = UINT_MAX;
raw_spin_unlock(&logbuf_lock);
lockdep_on();
- local_irq_restore(flags);
-
- /* If called from the scheduler, we can not call up(). */
- if (in_sched)
- return printed_len;
-
/*
* Disable preemption to avoid being preempted while holding
* console_sem which would prevent anyone from printing to console
*/
preempt_disable();
+ local_irq_restore(flags);
+
+ /* If called from the scheduler, we can not call up(). */
+ if (in_sched) {
+ preempt_enable();
+ return printed_len;
+ }
+
lockdep_off();
/*
* Try to acquire and then immediately release the console semaphore.
--
1.8.1.4


--ZJcv+A0YCCLh2VIg--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/