diff options
author | Cong Wang <cwang@twopensource.com> | 2014-05-12 18:11:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-15 15:30:33 -0400 |
commit | 200b916f3575bdf11609cb447661b8d5957b0bbf (patch) | |
tree | 7d9c385377dda2cddc5a4c0196189c65deeae4c1 /include/linux/rtnetlink.h | |
parent | e84d2f8d2ae33c8215429824e1ecf24cbca9645e (diff) |
rtnetlink: wait for unregistering devices in rtnl_link_unregister()
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>
Diffstat (limited to 'include/linux/rtnetlink.h')
-rw-r--r-- | include/linux/rtnetlink.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 8e3e66ac0a52..953937ea5233 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/mutex.h> | 5 | #include <linux/mutex.h> |
6 | #include <linux/netdevice.h> | 6 | #include <linux/netdevice.h> |
7 | #include <linux/wait.h> | ||
7 | #include <uapi/linux/rtnetlink.h> | 8 | #include <uapi/linux/rtnetlink.h> |
8 | 9 | ||
9 | extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); | 10 | extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); |
@@ -22,6 +23,10 @@ extern void rtnl_lock(void); | |||
22 | extern void rtnl_unlock(void); | 23 | extern void rtnl_unlock(void); |
23 | extern int rtnl_trylock(void); | 24 | extern int rtnl_trylock(void); |
24 | extern int rtnl_is_locked(void); | 25 | extern int rtnl_is_locked(void); |
26 | |||
27 | extern wait_queue_head_t netdev_unregistering_wq; | ||
28 | extern struct mutex net_mutex; | ||
29 | |||
25 | #ifdef CONFIG_PROVE_LOCKING | 30 | #ifdef CONFIG_PROVE_LOCKING |
26 | extern int lockdep_rtnl_is_held(void); | 31 | extern int lockdep_rtnl_is_held(void); |
27 | #else | 32 | #else |