Skip to content

Commit 87248d3

Browse files
arndbdavem330
authored andcommitted
netdevsim: remove incorrect __net_initdata annotations
The __net_initdata section cannot currently be used for structures that get cleaned up in an exitcall using unregister_pernet_operations: WARNING: vmlinux.o(.text+0x868c34): Section mismatch in reference from the function nsim_devlink_exit() to the (unknown reference) .init.data:(unknown) The function nsim_devlink_exit() references the (unknown reference) __initdata (unknown). This is often because nsim_devlink_exit lacks a __initdata annotation or the annotation of (unknown) is wrong. WARNING: vmlinux.o(.text+0x868c64): Section mismatch in reference from the function nsim_devlink_init() to the (unknown reference) .init.data:(unknown) WARNING: vmlinux.o(.text+0x8692bc): Section mismatch in reference from the function nsim_fib_exit() to the (unknown reference) .init.data:(unknown) WARNING: vmlinux.o(.text+0x869300): Section mismatch in reference from the function nsim_fib_init() to the (unknown reference) .init.data:(unknown) As that warning tells us, discarding the structure after a module is loaded would lead to a undefined behavior when that module is removed. It might be possible to change that annotation so it has no effect for loadable modules, but I have not figured out exactly how to do that, and we want this to be fixed in -rc1. This just removes the annotations, just like we do for all other such modules. Fixes: 37923ed ("netdevsim: Add simple FIB resource controller via devlink") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 458bd99 commit 87248d3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/net/netdevsim/devlink.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static int __net_init nsim_devlink_netns_init(struct net *net)
267267
return 0;
268268
}
269269

270-
static struct pernet_operations nsim_devlink_net_ops __net_initdata = {
270+
static struct pernet_operations nsim_devlink_net_ops = {
271271
.init = nsim_devlink_netns_init,
272272
.id = &nsim_devlink_id,
273273
.size = sizeof(bool),

‎drivers/net/netdevsim/fib.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static int __net_init nsim_fib_netns_init(struct net *net)
230230
return 0;
231231
}
232232

233-
static struct pernet_operations nsim_fib_net_ops __net_initdata = {
233+
static struct pernet_operations nsim_fib_net_ops = {
234234
.init = nsim_fib_netns_init,
235235
.id = &nsim_fib_net_id,
236236
.size = sizeof(struct nsim_fib_data),

0 commit comments

Comments
 (0)