On Wed, Aug 03, 2016 at 11:25:53PM +0200, Linus Lüssing wrote:
On Wed, Aug 03, 2016 at 09:59:27PM +0200, Sven Eckelmann wrote:
Isn't this causing the reference counting cycle (aka really, really, really bad):
Hm, I see what you are getting at. Could indeed be a nasty bug...
But, actually, just tested in VMs, seems like I'm getting a call to batadv_hardif_neigh_release() just fine. Which means it counted to zero successfully o_O?
I don't understand why it seems to work right now :D. Will dig deeper.
Ok, I think it just works because hardif_neigh_create() intializes the nodes refcount to one (in contrast to other allocating functions which initialize to 2). In the end, once neigh_node_create() finishes, it stays at one.
So the regular purging routines will break the cycle in the end when they reduce the refcount of the hardif_neigh_node to zero.