diff mbox series

tty/sysrq: Do not call sync directly from sysrq_do_reset()

Message ID 20181113231012.14184-1-mark.tomlinson@alliedtelesis.co.nz (mailing list archive)
State Mainlined
Commit 8fefbc6d4b26604be3ce627910a22aaeb7c382fd
Headers show
Series tty/sysrq: Do not call sync directly from sysrq_do_reset() | expand

Commit Message

Mark Tomlinson Nov. 13, 2018, 11:10 p.m. UTC
sysrq_do_reset() is called in softirq context, so it cannot call
sync() directly. Instead, call orderly_reboot(), which creates a work
item to run /sbin/reboot, or do emergency_sync and restart if the
command fails.

Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
---
 drivers/tty/sysrq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index ad1ee5d01b53..f2ca32c1ad7c 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -660,8 +660,7 @@  static void sysrq_do_reset(struct timer_list *t)
 
 	state->reset_requested = true;
 
-	ksys_sync();
-	kernel_restart(NULL);
+	orderly_reboot();
 }
 
 static void sysrq_handle_reset_request(struct sysrq_state *state)