[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250206-netcon_cpu-v5-5-859b23cc3826@debian.org>
Date: Thu, 06 Feb 2025 03:05:56 -0800
From: Breno Leitao <leitao@...ian.org>
To: Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, Jonathan Corbet <corbet@....net>,
Shuah Khan <shuah@...nel.org>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kselftest@...r.kernel.org,
rdunlap@...radead.org, Breno Leitao <leitao@...ian.org>,
kernel-team@...a.com
Subject: [PATCH net-next v5 5/8] netconsole: Include sysdata in extradata
entry count
Modify count_extradata_entries() to include sysdata fields when
calculating the total number of extradata entries. This change ensures
that the sysdata feature, specifically the CPU number field, is
correctly counted against the MAX_EXTRADATA_ITEMS limit.
The modification adds a simple check for the CPU_NR flag in the
sysdata_fields, incrementing the entry count accordingly.
Signed-off-by: Breno Leitao <leitao@...ian.org>
Reviewed-by: Simon Horman <horms@...nel.org>
---
drivers/net/netconsole.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 710330ae8ee462083dbb4aa889cb0ba0cb5a7475..50739c7dbfb6ad5b1a65ef33325cf4dd6ed02031 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -694,7 +694,15 @@ static ssize_t remote_ip_store(struct config_item *item, const char *buf,
*/
static size_t count_extradata_entries(struct netconsole_target *nt)
{
- return list_count_nodes(&nt->userdata_group.cg_children);
+ size_t entries;
+
+ /* Userdata entries */
+ entries = list_count_nodes(&nt->userdata_group.cg_children);
+ /* Plus sysdata entries */
+ if (nt->sysdata_fields & CPU_NR)
+ entries += 1;
+
+ return entries;
}
static ssize_t remote_mac_store(struct config_item *item, const char *buf,
--
2.43.5
Powered by blists - more mailing lists