netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2] netconsole: Do not shutdown dynamic configuration if cmdline is invalid
@ 2024-05-28  8:42 Breno Leitao
  2024-05-30  0:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Breno Leitao @ 2024-05-28  8:42 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: thepacketgeek, Aijay Adams, open list:NETWORKING DRIVERS,
	open list

If a user provides an invalid netconsole configuration during boot time
(e.g., specifying an invalid ethX interface), netconsole will be
entirely disabled. Consequently, the user won't be able to create new
entries in /sys/kernel/config/netconsole/ as that directory does not
exist.

Apart from misconfiguration, another issue arises when ethX is loaded as
a module and the netconsole= line in the command line points to ethX,
resulting in an obvious failure. This renders netconsole unusable, as
/sys/kernel/config/netconsole/ will never appear. This is more annoying
since users reconfigure (or just toggle) the configuratin later (see
commit 5fbd6cdbe304b ("netconsole: Attach cmdline target to dynamic
target"))

Create /sys/kernel/config/netconsole/ even if the command line arguments
are invalid, so, users can create dynamic entries in netconsole.

Reported-by: Aijay Adams <aijay@meta.com>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
Changelog:

v2:
 * Use IS_ENABLED(CONFIG_NETCONSOLE_DYNAMIC) directly instead of a
   external function to check if dynamic reconfiguration is enabled.

---
 drivers/net/netconsole.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index d7070dd4fe73..ab8a0623b1a1 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -1262,6 +1262,8 @@ static int __init init_netconsole(void)
 		while ((target_config = strsep(&input, ";"))) {
 			nt = alloc_param_target(target_config, count);
 			if (IS_ERR(nt)) {
+				if (IS_ENABLED(CONFIG_NETCONSOLE_DYNAMIC))
+					continue;
 				err = PTR_ERR(nt);
 				goto fail;
 			}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net v2] netconsole: Do not shutdown dynamic configuration if cmdline is invalid
  2024-05-28  8:42 [PATCH net v2] netconsole: Do not shutdown dynamic configuration if cmdline is invalid Breno Leitao
@ 2024-05-30  0:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-30  0:30 UTC (permalink / raw)
  To: Breno Leitao
  Cc: davem, edumazet, kuba, pabeni, thepacketgeek, aijay, netdev,
	linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 28 May 2024 01:42:24 -0700 you wrote:
> If a user provides an invalid netconsole configuration during boot time
> (e.g., specifying an invalid ethX interface), netconsole will be
> entirely disabled. Consequently, the user won't be able to create new
> entries in /sys/kernel/config/netconsole/ as that directory does not
> exist.
> 
> Apart from misconfiguration, another issue arises when ethX is loaded as
> a module and the netconsole= line in the command line points to ethX,
> resulting in an obvious failure. This renders netconsole unusable, as
> /sys/kernel/config/netconsole/ will never appear. This is more annoying
> since users reconfigure (or just toggle) the configuratin later (see
> commit 5fbd6cdbe304b ("netconsole: Attach cmdline target to dynamic
> target"))
> 
> [...]

Here is the summary with links:
  - [net,v2] netconsole: Do not shutdown dynamic configuration if cmdline is invalid
    https://git.kernel.org/netdev/net-next/c/c3390677f625

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-30  0:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-28  8:42 [PATCH net v2] netconsole: Do not shutdown dynamic configuration if cmdline is invalid Breno Leitao
2024-05-30  0:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).