Subject: Re: [PATCH] netconsole: Fix compiler warnings when PRINTK_EXECUTION_CTX is disabled

From: Breno Leitao <[email-masked]>
Date: Mon, 9 Mar 2026 05:21:00 -0700

Hello Chelsy,

On Mon, Mar 09, 2026 at 05:12:33AM -0700, Chelsy Ratnawat wrote:
> The netconsole change that started using nbcon_write_context for CPU
> and task information assumes CONFIG_PRINTK_EXECUTION_CTX is enabled.

in fact, NETCONSOLE_DYNAMIC selects CONFIG_PRINTK_EXECUTION_CTX. In
other words, were you able to get NETCONSOLE_DYNAMIC without having
CONFIG_PRINTK_EXECUTION_CTX set?

> However, when this option is disabled, struct nbcon_write_context does
> not contain the cpu and comm fields, causing compilation failures:
> 
>   error: 'struct nbcon_write_context' has no member named 'cpu'
>   error: 'struct nbcon_write_context' has no member named 'comm'
> 
> Guard access to these fields and fall back to raw_smp_processor_id()
> and current->comm when PRINTK_EXECUTION_CTX is disabled.

Please don't do it. We want to disable NETCONSOLE_DYNAMIC to be enabled
(thus, not using ->cpu and ->comm) if CONFIG_PRINTK_EXECUTION_CTX is not
set.

Thanks for the report,
--breno