diff mbox series

ipmr: Don't mark ip6mr_rtnl_msg_handlers as __initconst

Message ID 20241018151217.3558216-1-arnd@kernel.org (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series ipmr: Don't mark ip6mr_rtnl_msg_handlers as __initconst | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5 this patch: 5
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 6 this patch: 6
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-10-19--00-00 (tests: 777)

Commit Message

Arnd Bergmann Oct. 18, 2024, 3:12 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

This gets referenced by the ip6_mr_cleanup function, so it must not be
discarded early:

WARNING: modpost: vmlinux: section mismatch in reference: ip6_mr_cleanup+0x14 (section: .exit.text) -> ip6mr_rtnl_msg_handlers (section: .init.rodata)
ERROR: modpost: Section mismatches detected.
Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.

Fixes: 3ac84e31b33e ("ipmr: Use rtnl_register_many().")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 net/ipv6/ip6mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kuniyuki Iwashima Oct. 18, 2024, 4:31 p.m. UTC | #1
From: Arnd Bergmann <arnd@kernel.org>
Date: Fri, 18 Oct 2024 15:12:14 +0000
> From: Arnd Bergmann <arnd@arndb.de>
> 
> This gets referenced by the ip6_mr_cleanup function, so it must not be
> discarded early:
> 
> WARNING: modpost: vmlinux: section mismatch in reference: ip6_mr_cleanup+0x14 (section: .exit.text) -> ip6mr_rtnl_msg_handlers (section: .init.rodata)
> ERROR: modpost: Section mismatches detected.
> Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.
> 
> Fixes: 3ac84e31b33e ("ipmr: Use rtnl_register_many().")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Hi,

I posted this yesterday.
https://lore.kernel.org/netdev/20241017174732.39487-1-kuniyu@amazon.com/

Thanks


> ---
>  net/ipv6/ip6mr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
> index 437a9fdb67f5..f7892afba980 100644
> --- a/net/ipv6/ip6mr.c
> +++ b/net/ipv6/ip6mr.c
> @@ -1367,7 +1367,7 @@ static struct pernet_operations ip6mr_net_ops = {
>  	.exit_batch = ip6mr_net_exit_batch,
>  };
>  
> -static const struct rtnl_msg_handler ip6mr_rtnl_msg_handlers[] __initconst_or_module = {
> +static const struct rtnl_msg_handler ip6mr_rtnl_msg_handlers[] = {
>  	{.owner = THIS_MODULE, .protocol = RTNL_FAMILY_IP6MR,
>  	 .msgtype = RTM_GETROUTE,
>  	 .doit = ip6mr_rtm_getroute, .dumpit = ip6mr_rtm_dumproute},
> -- 
> 2.39.5
Arnd Bergmann Oct. 18, 2024, 7:09 p.m. UTC | #2
On Fri, Oct 18, 2024, at 16:31, Kuniyuki Iwashima wrote:
> From: Arnd Bergmann <arnd@kernel.org>
> Date: Fri, 18 Oct 2024 15:12:14 +0000
>> From: Arnd Bergmann <arnd@arndb.de>
>> 
>> This gets referenced by the ip6_mr_cleanup function, so it must not be
>> discarded early:
>> 
>> WARNING: modpost: vmlinux: section mismatch in reference: ip6_mr_cleanup+0x14 (section: .exit.text) -> ip6mr_rtnl_msg_handlers (section: .init.rodata)
>> ERROR: modpost: Section mismatches detected.
>> Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.
>> 
>> Fixes: 3ac84e31b33e ("ipmr: Use rtnl_register_many().")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Hi,
>
> I posted this yesterday.
> https://lore.kernel.org/netdev/20241017174732.39487-1-kuniyu@amazon.com/

Right, your may be better then. I was confused by the
function name suggesting that this would be called in the
module_exit path, but I now see that it is only called
at init time, so that works.

     Arnd
Kuniyuki Iwashima Oct. 18, 2024, 7:17 p.m. UTC | #3
From: "Arnd Bergmann" <arnd@arndb.de>
Date: Fri, 18 Oct 2024 19:09:10 +0000
> On Fri, Oct 18, 2024, at 16:31, Kuniyuki Iwashima wrote:
> > From: Arnd Bergmann <arnd@kernel.org>
> > Date: Fri, 18 Oct 2024 15:12:14 +0000
> >> From: Arnd Bergmann <arnd@arndb.de>
> >> 
> >> This gets referenced by the ip6_mr_cleanup function, so it must not be
> >> discarded early:
> >> 
> >> WARNING: modpost: vmlinux: section mismatch in reference: ip6_mr_cleanup+0x14 (section: .exit.text) -> ip6mr_rtnl_msg_handlers (section: .init.rodata)
> >> ERROR: modpost: Section mismatches detected.
> >> Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.
> >> 
> >> Fixes: 3ac84e31b33e ("ipmr: Use rtnl_register_many().")
> >> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >
> > Hi,
> >
> > I posted this yesterday.
> > https://lore.kernel.org/netdev/20241017174732.39487-1-kuniyu@amazon.com/
> 
> Right, your may be better then. I was confused by the
> function name suggesting that this would be called in the
> module_exit path, but I now see that it is only called
> at init time, so that works.

Since the commit below, IPv6 has lost unloadability, and such cleanup
functions are only called from init path now.


commit 8ce440610357b77587433d0df647cea69a6890a8
Author: Cong Wang <amwang@redhat.com>
Date:   Sat Sep 21 11:12:21 2013 +0800

    ipv6: do not allow ipv6 module to be removed
diff mbox series

Patch

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 437a9fdb67f5..f7892afba980 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1367,7 +1367,7 @@  static struct pernet_operations ip6mr_net_ops = {
 	.exit_batch = ip6mr_net_exit_batch,
 };
 
-static const struct rtnl_msg_handler ip6mr_rtnl_msg_handlers[] __initconst_or_module = {
+static const struct rtnl_msg_handler ip6mr_rtnl_msg_handlers[] = {
 	{.owner = THIS_MODULE, .protocol = RTNL_FAMILY_IP6MR,
 	 .msgtype = RTM_GETROUTE,
 	 .doit = ip6mr_rtm_getroute, .dumpit = ip6mr_rtm_dumproute},