Re: [PATCH net-next v3 1/5] netconsole: send the oops when oops_only is set
From: Gustavo Luiz Duarte
Date: Wed Sep 23 2026 - 11:59:54 EST
On Mon, Sep 14, 2026 at 1:10 PM Breno Leitao <leitao@xxxxxxxxxx> wrote:
>
> A target running with oops_only=1 receives nothing when the kernel
> oopses, which is the one thing the option exists for. Only a panic
> still gets through.
>
> netconsole_write() bails out unless oops_in_progress is set, and that
> flag is already gone by the time netconsole runs. netconsole is
> CON_NBCON_ATOMIC_UNSAFE, so console_is_usable() keeps it out of the
> emergency flush an oops prints in, and the records only leave the box
> once the printer thread runs.
>
> die() wakes that thread from oops_exit(), by which point
> bust_spinlocks(0) has cleared oops_in_progress again. TAINT_DIE is set
> in between, so test that as well, behind a helper.
>
> With oops_only=1 on a netdevsim target, an lkdtm EXCEPTION produces 44
> lines of oops. The receiver gets none of them before this change and
> all of them after it, while ordinary messages stay suppressed.
>
> The taint never clears, so from the first oops on, an oops_only target
> sends everything instead of going quiet again. Sending the aftermath of
> a crash beats sending nothing.
>
> Fixes: 7eab73b18630 ("netconsole: convert to NBCON console infrastructure")
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
Reviewed-by: Gustavo Luiz Duarte <gustavold@xxxxxxxxx>