Revert r331298
Normally, shutdown_nice() just signals init. However, sometimes it calls kern_reboot directly. For that case, r331298 dropped the Giant lock before calling it. This turns out to be incorrect for the more common case where init exists and we just signal it. Restore the old behavior. The direct call to kern_reboot() doesn't sync buffers to the disk, so should work with Giant held, so we don't need to drop locks here for that. Noticed by: bde@ Sponsored by: Netflix
This commit is contained in:
parent
ad5c8bd63a
commit
e7932420b0
@ -3858,28 +3858,22 @@ scgetc(sc_softc_t *sc, u_int flags, struct sc_cnstate *sp)
|
||||
|
||||
case RBT:
|
||||
#ifndef SC_DISABLE_REBOOT
|
||||
if (enable_reboot && !(flags & SCGETC_CN)) {
|
||||
mtx_unlock(&Giant);
|
||||
if (enable_reboot && !(flags & SCGETC_CN))
|
||||
shutdown_nice(0);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case HALT:
|
||||
#ifndef SC_DISABLE_REBOOT
|
||||
if (enable_reboot && !(flags & SCGETC_CN)) {
|
||||
mtx_unlock(&Giant);
|
||||
if (enable_reboot && !(flags & SCGETC_CN))
|
||||
shutdown_nice(RB_HALT);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case PDWN:
|
||||
#ifndef SC_DISABLE_REBOOT
|
||||
if (enable_reboot && !(flags & SCGETC_CN)) {
|
||||
mtx_unlock(&Giant);
|
||||
if (enable_reboot && !(flags & SCGETC_CN))
|
||||
shutdown_nice(RB_HALT|RB_POWEROFF);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user