sunvnet: call unregister_netdev() exactly once per device
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]@oracle.com
David Miller
maintainerFrom: [email protected]
Date: Tue, 8 Jul 2014 12:18:27 -0400
Quoted 6 lines
unregister_netdevthe parentnet_deviceonly after the last port in theport_listof a `struct vnet' is removed when the vnet is dismantled. Moreover, this should only be done if thenet_devicewas successfully registered.
Quoted 7 lines
Without this fix, 'modprobe -r sunvnet' could trigger the following in
rollback_registered_many()
5693BUG_ON(dev->reg_state != NETREG_REGISTERED);Signed-off-by Sowmini Varadhan <[email protected]>Acked-by Dave Kleikamp <[email protected]>Acked-by Dan Carpenter <[email protected]>
This is definitely not the right fix, you're just removing a symptom of a much larger problem.
And that problem is that nothing cleans up the objects created by vnet_new(), they are completely leaked.
vnet_exit(), after doing the vio_unregister_driver(), should call a helper function that iterates over vnet_list and cleans up those objects.
That's where the unregister_netdevice() belongs, not in vnet_port_remove().
Quoted 6 lines · David Miller
This is definitely not the right fix, you're just removing a symptom of a much larger problem.
And that problem is that nothing cleans up the objects created by
vnet_new(), they are completely leaked.
the bug(s) in modprobe -r is one manifestation of the problem and should certainly be fixed, I can look into the suggestions you have below.
But this is actually a bit worse. Whenever a node goes away, it triggers a vio_port_remove() on all the peering nodes, and blows away their networking. IOW this can happen without involving vnet_exit() at all. Thus it might be necessary for vio_port_remove() itself to check if its the last port before doing the unregister?
BTW, for some odd reason I did not see my original patch submission show up in the list. I'm not sure why.
Quoted 11 lines
vnet_exit(), after doing thevio_unregister_driver(), should call a helper function that iterates overvnet_listand cleans up those objects.That's where the
unregister_netdevice()belongs, not invnet_port_remove(). --
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html