• Jan Lübbe's avatar
    fix console change race exposed by CFS · a64314e6
    Jan Lübbe authored
    The new behaviour of CFS exposes a race which occurs if a switch is
    requested when vt_mode.mode is VT_PROCESS.
    
    The process with vc->vt_pid is signaled before vc->vt_newvt is set.
    This causes the switch to fail when triggered by the monitoing process
    because the target is still -1.
    
    [ If the signal sending fails, the subsequent "reset_vc(vc)" will then
      reset vt_newvt to -1, so this works for that case too.   - Linus ]
    Signed-off-by: default avatarJan Lübbe <jluebbe@lasnet.de>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    a64314e6
vt_ioctl.c 29.2 KB