aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 18bde979f346..1d965808c1c8 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -32,6 +32,7 @@
32#include <linux/getcpu.h> 32#include <linux/getcpu.h>
33#include <linux/task_io_accounting_ops.h> 33#include <linux/task_io_accounting_ops.h>
34#include <linux/seccomp.h> 34#include <linux/seccomp.h>
35#include <linux/hardirq.h>
35#include <linux/cpu.h> 36#include <linux/cpu.h>
36#include <linux/ptrace.h> 37#include <linux/ptrace.h>
37#include <linux/fs_struct.h> 38#include <linux/fs_struct.h>
@@ -283,6 +284,15 @@ out_unlock:
283 */ 284 */
284void emergency_restart(void) 285void emergency_restart(void)
285{ 286{
287 /*
288 * Call the notifier chain if we are not in an
289 * atomic context:
290 */
291#ifdef CONFIG_PREEMPT
292 if (!in_atomic() && !irqs_disabled())
293 blocking_notifier_call_chain(&reboot_notifier_list,
294 SYS_RESTART, NULL);
295#endif
286 machine_emergency_restart(); 296 machine_emergency_restart();
287} 297}
288EXPORT_SYMBOL_GPL(emergency_restart); 298EXPORT_SYMBOL_GPL(emergency_restart);