OpenVZ Forum


Home » Mailing lists » Devel » NET namespace locking seems broken to me
NET namespace locking seems broken to me [message #20540] Thu, 20 September 2007 11:29 Go to previous message
den is currently offline  den
Messages: 494
Registered: December 2005
Senior Member
Hello, Eric!

Current locking in mainstream seems broken to me.

1. struct net->list is manipulated under double net_mutex/net_list_mutex
2. net_list_mutex has been taken only in cleanup_net/net_ns_init inside
net_mutes and seems pointless now
3. for_each_net (iterating against net_namespace_list) is called from
   a) register_netdevice_notifier/__rtnl_link_unregister
   b) register_pernet_operations/unregister_pernet_operations
   In the case b) the situation is sane, i.e. net_mutex is held while in
the case b) we held rtnl_only

So, this does not look good to me for now.
How to cure this situation? I think that we can drop all locks for now
and perform all operations under rtnl only. In the other case we must
decide now should we make rtnl inner or outer for net_mutex.

>From my point of view net_mutex should be taken inside rtnl lock and we
must add it now into list manipulation routines.

Plz point me to my mistake in logic :)

Regards,
	Den

P.S. The GIT with your latest tree is also affected
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH 00/16] core network namespace support
Next Topic: [PATCH 0/5] Kernel memory accounting container (v3)
Goto Forum:
  


Current Time: Mon Aug 18 22:09:55 GMT 2025

Total time taken to generate the page: 0.19806 seconds