OSDN Git Service

tty/sysrq: Do not call sync directly from sysrq_do_reset()
authorMark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Mon, 26 Nov 2018 20:57:23 +0000 (09:57 +1300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Dec 2018 11:02:12 +0000 (12:02 +0100)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/sysrq.c

index 28fb20e..1f03078 100644 (file)
@@ -653,8 +653,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)