]> git.ipfire.org Git - people/ms/linux.git/commit
rtnetlink: wait for unregistering devices in rtnl_link_unregister()
authorCong Wang <cwang@twopensource.com>
Mon, 12 May 2014 22:11:20 +0000 (15:11 -0700)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 May 2014 09:49:31 +0000 (11:49 +0200)
commit2413d40d59007671d3cd3121e3b0248260e34f3e
treeea256dfd04d353e512c1e7a11ebde1febbd868f4
parent166c6b578bc07449529aa40ba524c694c2fd1623
rtnetlink: wait for unregistering devices in rtnl_link_unregister()

[ Upstream commit 200b916f3575bdf11609cb447661b8d5957b0bbf ]

From: Cong Wang <cwang@twopensource.com>

commit 50624c934db18ab90 (net: Delay default_device_exit_batch until no
devices are unregistering) introduced rtnl_lock_unregistering() for
default_device_exit_batch(). Same race could happen we when rmmod a driver
which calls rtnl_link_unregister() as we call dev->destructor without rtnl
lock.

For long term, I think we should clean up the mess of netdev_run_todo()
and net namespce exit code.

Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
include/linux/rtnetlink.h
net/core/dev.c
net/core/net_namespace.c
net/core/rtnetlink.c