• Hidetoshi Seto's avatar
    sysrq, kdump: make sysrq-c consistent · cab8bd34
    Hidetoshi Seto authored
    commit d6580a9f ("kexec: sysrq: simplify
    sysrq-c handler") changed the behavior of sysrq-c to unconditional
    dereference of NULL pointer.  So in cases with CONFIG_KEXEC, where
    crash_kexec() was directly called from sysrq-c before, now it can be said
    that a step of "real oops" was inserted before starting kdump.
    
    However, in contrast to oops via SysRq-c from keyboard which results in
    panic due to in_interrupt(), oops via "echo c > /proc/sysrq-trigger" will
    not become panic unless panic_on_oops=1.  It means that even if dump is
    properly configured to be taken on panic, the sysrq-c from proc interface
    might not start crashdump while the sysrq-c from keyboard can start
    crashdump.  This confuses traditional users of kdump, i.e.  people who
    expect sysrq-c to do common behavior in both of the keyboard and proc
    interface.
    
    This patch brings the keyboard and proc interface behavior of sysrq-c in
    line, by forcing panic_on_oops=1 before oops in sysrq-c handler.
    
    And some updates in documentation are included, to clarify that there is
    no longer dependency with CONFIG_KEXEC, and that now the system can just
    crash by sysrq-c if no dump mechanism is configured.
    Signed-off-by: default avatarHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
    Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
    Cc: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
    Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
    Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
    Cc: Brayan Arraes <brayan@yack.com.br>
    Cc: Eric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    cab8bd34
sysrq.c 14.6 KB