On Montag, 1. August 2016 22:38:46 CEST Linus Lüssing wrote:
--- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -236,6 +236,7 @@ static void batadv_hardif_neigh_release(struct kref *ref) spin_unlock_bh(&hardif_neigh->if_incoming->neigh_list_lock);
batadv_hardif_put(hardif_neigh->if_incoming);
- batadv_orig_node_put(hardif_neigh->orig_node); kfree_rcu(hardif_neigh, rcu);
}
[...]
@@ -539,6 +541,9 @@ batadv_hardif_neigh_create(struct batadv_hard_iface *hard_iface, hardif_neigh->if_incoming = hard_iface; hardif_neigh->last_seen = jiffies;
kref_get(&orig_node->refcount);
hardif_neigh->orig_node = orig_node;
kref_init(&hardif_neigh->refcount);
if (bat_priv->algo_ops->neigh.hardif_init)
[...]
@@ -418,6 +419,7 @@ struct batadv_hardif_neigh_node { struct hlist_node list; u8 addr[ETH_ALEN]; struct batadv_hard_iface *if_incoming;
- struct batadv_orig_node *orig_node; unsigned long last_seen;
#ifdef CONFIG_BATMAN_ADV_BATMAN_V struct batadv_hardif_neigh_node_bat_v bat_v;
Isn't this causing the reference counting cycle (aka really, really, really bad):
batadv_orig_node::last_bonding_candidate -> batadv_orig_info batadv_orig_node::neigh_list -> batadv_neigh_node batadv_orig_ifino::router -> batadv_neigh_node batadv_neigh_node::hardif_neigh -> batadv_hardif_neigh_node batadv_hardif_neigh_node::orig_node -> batadv_orig_node
See the attached graphic for a visualization.
Kind regards, Sven