* [PATCH net-next] tipc: fix a slab object leak
@ 2015-04-01 1:42 Ying Xue
2015-04-01 3:13 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Ying Xue @ 2015-04-01 1:42 UTC (permalink / raw)
To: davem; +Cc: jon.maloy, erik.hugne, netdev, tipc-discussion
When remove TIPC module, there is a warning to remind us that a slab
object is leaked like:
root@localhost:~# rmmod tipc
[ 19.056226] =============================================================================
[ 19.057549] BUG TIPC (Not tainted): Objects remaining in TIPC on kmem_cache_close()
[ 19.058736] -----------------------------------------------------------------------------
[ 19.058736]
[ 19.060287] INFO: Slab 0xffffea0000519a00 objects=23 used=1 fp=0xffff880014668b00 flags=0x100000000004080
[ 19.061915] INFO: Object 0xffff880014668000 @offset=0
[ 19.062717] kmem_cache_destroy TIPC: Slab cache still has objects
This is because the listening socket of TIPC topology server is not
closed before TIPC proto handler is unregistered with proto_unregister().
However, as the socket is closed in tipc_exit_net() which is called by
unregister_pernet_subsys() during unregistering TIPC namespace operation,
the warning can be eliminated if calling unregister_pernet_subsys() is
moved before calling proto_unregister().
Fixes: e05b31f4bf89 ("tipc: make tipc socket support net namespace")
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
---
net/tipc/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 935205e..be1c9fa 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -152,11 +152,11 @@ out_netlink:
static void __exit tipc_exit(void)
{
tipc_bearer_cleanup();
+ unregister_pernet_subsys(&tipc_net_ops);
tipc_netlink_stop();
tipc_netlink_compat_stop();
tipc_socket_stop();
tipc_unregister_sysctl();
- unregister_pernet_subsys(&tipc_net_ops);
pr_info("Deactivated\n");
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tipc: fix a slab object leak
2015-04-01 1:42 [PATCH net-next] tipc: fix a slab object leak Ying Xue
@ 2015-04-01 3:13 ` David Miller
2015-04-01 3:16 ` Ying Xue
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2015-04-01 3:13 UTC (permalink / raw)
To: ying.xue; +Cc: jon.maloy, erik.hugne, netdev, tipc-discussion
From: Ying Xue <ying.xue@windriver.com>
Date: Wed, 1 Apr 2015 09:42:50 +0800
> When remove TIPC module, there is a warning to remind us that a slab
> object is leaked like:
>
> root@localhost:~# rmmod tipc
> [ 19.056226] =============================================================================
> [ 19.057549] BUG TIPC (Not tainted): Objects remaining in TIPC on kmem_cache_close()
> [ 19.058736] -----------------------------------------------------------------------------
> [ 19.058736]
> [ 19.060287] INFO: Slab 0xffffea0000519a00 objects=23 used=1 fp=0xffff880014668b00 flags=0x100000000004080
> [ 19.061915] INFO: Object 0xffff880014668000 @offset=0
> [ 19.062717] kmem_cache_destroy TIPC: Slab cache still has objects
>
> This is because the listening socket of TIPC topology server is not
> closed before TIPC proto handler is unregistered with proto_unregister().
> However, as the socket is closed in tipc_exit_net() which is called by
> unregister_pernet_subsys() during unregistering TIPC namespace operation,
> the warning can be eliminated if calling unregister_pernet_subsys() is
> moved before calling proto_unregister().
>
> Fixes: e05b31f4bf89 ("tipc: make tipc socket support net namespace")
> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
> Signed-off-by: Ying Xue <ying.xue@windriver.com>
This bug exists in 'net', so that's where I'm applying it.
Can you please target your patches properly, I shouldn't be
doing this kind of work for you.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tipc: fix a slab object leak
2015-04-01 3:13 ` David Miller
@ 2015-04-01 3:16 ` Ying Xue
2015-04-01 4:19 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Ying Xue @ 2015-04-01 3:16 UTC (permalink / raw)
To: David Miller; +Cc: jon.maloy, erik.hugne, netdev, tipc-discussion
On 04/01/2015 11:13 AM, David Miller wrote:
> This bug exists in 'net', so that's where I'm applying it.
>
> Can you please target your patches properly, I shouldn't be
> doing this kind of work for you.
Sure, I will recreate the patch targeted at "net" tree.
Thanks,
Ying
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tipc: fix a slab object leak
2015-04-01 3:16 ` Ying Xue
@ 2015-04-01 4:19 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-04-01 4:19 UTC (permalink / raw)
To: ying.xue; +Cc: jon.maloy, erik.hugne, netdev, tipc-discussion
From: Ying Xue <ying.xue@windriver.com>
Date: Wed, 1 Apr 2015 11:16:12 +0800
> On 04/01/2015 11:13 AM, David Miller wrote:
>> This bug exists in 'net', so that's where I'm applying it.
>>
>> Can you please target your patches properly, I shouldn't be
>> doing this kind of work for you.
>
> Sure, I will recreate the patch targeted at "net" tree.
I said I applied it, there is nothing for you to do.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-01 4:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-01 1:42 [PATCH net-next] tipc: fix a slab object leak Ying Xue
2015-04-01 3:13 ` David Miller
2015-04-01 3:16 ` Ying Xue
2015-04-01 4:19 ` David Miller
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).