Re: [GIT PULL] Networking for v6.13-rc1
From: Paolo Abeni
Date: Thu Nov 28 2024 - 11:01:23 EST
On 11/28/24 16:46, Paolo Abeni wrote:
> On 11/28/24 15:48, Sasha Levin wrote:
>> On Thu, Nov 28, 2024 at 03:27:38PM +0100, Paolo Abeni wrote:
>>> ipmr: add debug check for mr table cleanup
>>
>> When merging this PR into linus-next, I've noticed it introduced build
>> errors:
>>
>> /builds/linux/net/ipv4/ipmr.c:320:13: error: function 'ipmr_can_free_table' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
>> 320 | static bool ipmr_can_free_table(struct net *net)
>> | ^~~~~~~~~~~~~~~~~~~
>> 1 error generated.
>>
>> The commit in question isn't in linux-next and seems to be broken.
>
> My fault, I'm sorry.
>
> I can't reproduce the issue here.
I see it now. It's clang with CONFIG_DEBUG_NET=n. Apparently clang is
too smart with BUILD_BUG_ON_INVALID().
A trivial fix would be:
---
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 383ea8b91cc7..c5b8ec5c0a8c 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -437,7 +437,7 @@ static void ipmr_free_table(struct mr_table *mrt)
{
struct net *net = read_pnet(&mrt->net);
- DEBUG_NET_WARN_ON_ONCE(!ipmr_can_free_table(net));
+ WARN_ON_ONCE(!ipmr_can_free_table(net));
timer_shutdown_sync(&mrt->ipmr_expire_timer);
mroute_clean_tables(mrt, MRT_FLUSH_VIFS | MRT_FLUSH_VIFS_STATIC |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 4147890fe98f..7f1902ac3586 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -416,7 +416,7 @@ static void ip6mr_free_table(struct mr_table *mrt)
{
struct net *net = read_pnet(&mrt->net);
- DEBUG_NET_WARN_ON_ONCE(!ip6mr_can_free_table(net));
+ WARN_ON_ONCE(!ip6mr_can_free_table(net));
timer_shutdown_sync(&mrt->ipmr_expire_timer);
mroute_clean_tables(mrt, MRT6_FLUSH_MIFS | MRT6_FLUSH_MIFS_STATIC |