From: John Stultz Date: Thu, 22 May 2014 00:43:35 +0000 (+1000) Subject: printk: disable preemption for printk_sched X-Git-Tag: next-20140530~2^2~179 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3c3ad385a174d5d2490b2f9c6513b588dc8a1ddb;p=karo-tx-linux.git printk: disable preemption for printk_sched An earlier change in -mm (printk: remove separate printk_sched buffers...), removed the printk_sched irqsave/restore lines since it was safe for current users. Since we may be expanding usage of printk_sched(), disable preepmtion for this function to make it more generally safe to call. Signed-off-by: John Stultz Reviewed-by: Jan Kara Cc: Peter Zijlstra Cc: Jiri Bohac Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Steven Rostedt Signed-off-by: Andrew Morton --- diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 398142eddbcf..5aba603cf0d8 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2589,12 +2589,14 @@ int printk_sched(const char *fmt, ...) va_list args; int r; + preempt_disable(); va_start(args, fmt); r = vprintk_emit(0, SCHED_MESSAGE_LOGLEVEL, NULL, 0, fmt, args); va_end(args); __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT); irq_work_queue(&__get_cpu_var(wake_up_klogd_work)); + preempt_enable(); return r; }