* [PATCH net] netconsole: fix appending sysdata when sysdata_fields == SYSDATA_RELEASE
@ 2025-06-09 18:24 Gustavo Luiz Duarte
2025-06-10 8:06 ` Breno Leitao
2025-06-10 23:39 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Gustavo Luiz Duarte @ 2025-06-09 18:24 UTC (permalink / raw)
To: Breno Leitao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, Gustavo Luiz Duarte
Before appending sysdata, prepare_extradata() checks if any feature is
enabled in sysdata_fields (and exits early if none is enabled).
When SYSDATA_RELEASE was introduced, we missed adding it to the list of
features being checked against sysdata_fields in prepare_extradata().
The result was that, if only SYSDATA_RELEASE is enabled in
sysdata_fields, we incorreclty exit early and fail to append the
release.
Instead of checking specific bits in sysdata_fields, check if
sysdata_fields has ALL bit zeroed and exit early if true. This fixes
case when only SYSDATA_RELEASE enabled and makes the code more general /
less error prone in future feature implementation.
Signed-off-by: Gustavo Luiz Duarte <gustavold@gmail.com>
---
drivers/net/netconsole.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 4289ccd3e41b..176935a8645f 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -1252,7 +1252,6 @@ static int sysdata_append_release(struct netconsole_target *nt, int offset)
*/
static int prepare_extradata(struct netconsole_target *nt)
{
- u32 fields = SYSDATA_CPU_NR | SYSDATA_TASKNAME;
int extradata_len;
/* userdata was appended when configfs write helper was called
@@ -1260,7 +1259,7 @@ static int prepare_extradata(struct netconsole_target *nt)
*/
extradata_len = nt->userdata_length;
- if (!(nt->sysdata_fields & fields))
+ if (!nt->sysdata_fields)
goto out;
if (nt->sysdata_fields & SYSDATA_CPU_NR)
---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250609-netconsole-fix-5465e2fd8f83
Best regards,
--
Gustavo Luiz Duarte <gustavold@gmail.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] netconsole: fix appending sysdata when sysdata_fields == SYSDATA_RELEASE
2025-06-09 18:24 [PATCH net] netconsole: fix appending sysdata when sysdata_fields == SYSDATA_RELEASE Gustavo Luiz Duarte
@ 2025-06-10 8:06 ` Breno Leitao
2025-06-10 23:39 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Breno Leitao @ 2025-06-10 8:06 UTC (permalink / raw)
To: Gustavo Luiz Duarte
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev, linux-kernel
On Mon, Jun 09, 2025 at 11:24:20AM -0700, Gustavo Luiz Duarte wrote:
> Before appending sysdata, prepare_extradata() checks if any feature is
> enabled in sysdata_fields (and exits early if none is enabled).
>
> When SYSDATA_RELEASE was introduced, we missed adding it to the list of
> features being checked against sysdata_fields in prepare_extradata().
> The result was that, if only SYSDATA_RELEASE is enabled in
> sysdata_fields, we incorreclty exit early and fail to append the
> release.
>
> Instead of checking specific bits in sysdata_fields, check if
> sysdata_fields has ALL bit zeroed and exit early if true. This fixes
> case when only SYSDATA_RELEASE enabled and makes the code more general /
> less error prone in future feature implementation.
>
> Signed-off-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Fixes: dd30ae533242 ("netconsole: append release to sysdata")
Reviewed-by: Breno Leitao <leitao@debian.org>
Thanks for the fix,
--breno
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] netconsole: fix appending sysdata when sysdata_fields == SYSDATA_RELEASE
2025-06-09 18:24 [PATCH net] netconsole: fix appending sysdata when sysdata_fields == SYSDATA_RELEASE Gustavo Luiz Duarte
2025-06-10 8:06 ` Breno Leitao
@ 2025-06-10 23:39 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-10 23:39 UTC (permalink / raw)
To: Gustavo Luiz Duarte
Cc: leitao, andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 09 Jun 2025 11:24:20 -0700 you wrote:
> Before appending sysdata, prepare_extradata() checks if any feature is
> enabled in sysdata_fields (and exits early if none is enabled).
>
> When SYSDATA_RELEASE was introduced, we missed adding it to the list of
> features being checked against sysdata_fields in prepare_extradata().
> The result was that, if only SYSDATA_RELEASE is enabled in
> sysdata_fields, we incorreclty exit early and fail to append the
> release.
>
> [...]
Here is the summary with links:
- [net] netconsole: fix appending sysdata when sysdata_fields == SYSDATA_RELEASE
https://git.kernel.org/netdev/net/c/c85bf1975108
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] 3+ messages in thread
end of thread, other threads:[~2025-06-10 23:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-09 18:24 [PATCH net] netconsole: fix appending sysdata when sysdata_fields == SYSDATA_RELEASE Gustavo Luiz Duarte
2025-06-10 8:06 ` Breno Leitao
2025-06-10 23:39 ` 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).