Hi there,
We've been running this for a few time and it's very usefull. So is there any news on merging this into the kernel ? Or is the BLA thing blocking ?
However, this patch seems to leak some vlan entries on softif interface deletion. For me simply running a kernel with kmemeleak & doing a simple ip link del bat0 shows splats like theese:
This should take care of kmemleak reports as this one: unreferenced object 0xffff00000cadff00 (size 128): comm "xxx", pid 913, jiffies 4294914994 (age 77762.956s) hex dump (first 32 bytes): 40 c9 35 05 00 00 ff ff 00 00 00 00 00 00 00 00 @.5............. 39 77 ff 61 01 00 00 00 00 00 00 00 00 00 00 00 9w.a............ backtrace: [<00000000f10febf1>] __kmem_cache_alloc_node+0x1d4/0x340 [<00000000178f97a6>] kmalloc_trace+0x40/0x128 [<0000000087db8410>] batadv_softif_vlan_get_or_create+0xa0/0x1c0 [<000000009f648859>] batadv_tt_local_add+0x7ec/0x10f8 [<00000000c0dacbb0>] batadv_softif_create_vlan_own+0x48/0x60 [<00000000676cacd0>] batadv_hard_if_event+0x1a0/0xb58 [<00000000cd053741>] notifier_call_chain+0xb0/0x220 [<0000000019022ed7>] raw_notifier_call_chain+0x1c/0x30 [<00000000e22f9034>] call_netdevice_notifiers_info+0x6c/0xc0 [<00000000fb639003>] register_netdevice+0x5ec/0x778 [<00000000e2ac250c>] batadv_softif_newlink+0x48/0x68 [<00000000b65a146a>] __rtnl_newlink+0x81c/0xb10 [<00000000a91fbe5b>] rtnl_newlink+0x60/0x90 [<0000000043273284>] rtnetlink_rcv_msg+0x3d8/0x568 [<00000000da2bd331>] netlink_rcv_skb+0xc0/0x1e0 [<000000007523d87a>] rtnetlink_rcv+0x1c/0x30
So I fixed it by removing the extra refs that is hold for the vlan entry when added to the global list. For me it seems superfluous. This way it also means that when a vlan entry gets deleted (because the last tt entry holding a ref to it gets dropped) the vlan is freed instead of staying there forever.
Or maybe I missed something ?
--- net/batman-adv/soft-interface.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index b61f35918b5d..d7de54734725 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -599,7 +599,6 @@ batadv_softif_create_vlan(struct batadv_priv *bat_priv, unsigned short vid)
atomic_set(&vlan->ap_isolation, 0);
- kref_get(&vlan->refcount); hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list); spin_unlock_bh(&bat_priv->softif_vlan_list_lock);