diff options
| author | David S. Miller <davem@nuts.ninka.net> | 2003-05-19 04:30:48 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2003-05-19 04:30:48 -0700 |
| commit | ff936f4e8148e75b20595eda5de6d3a4bb55b631 (patch) | |
| tree | 96e7b8175a9da098dde77ee24e030258a2fe4ee1 /kernel/kmod.c | |
| parent | 3b1d5e1d06c7d8c6d24f565ef2a7d1cdfdf9a908 (diff) | |
[NET]: Fix netdevice unregister races.
We had two major issues when unregistering networking devices.
1) Even trying to run hotplug asynchronously could deadlock
if keventd was currently trying to get the RTNL semaphore
in order to process linkwatch events.
2) Unregister needs to wait for the last reference to go away
before the finalization of the unregister can execute. This
cannot occur under the RTNL semaphore as this is deadlock
prone as well.
The solution is to do all of this stuff after dropping the
RTNL semaphore. rtnl_lock, if it is about to protect a region
of code that could unregister network devices, registers a list
to which unregistered netdevs are attached. At rtnl_unlock time
this list is processed to wait for refcounts to drop to zero and
then finalize the unregister.
Diffstat (limited to 'kernel/kmod.c')
| -rw-r--r-- | kernel/kmod.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c index 64a6d9ff86c3..8ceea8e842b7 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -264,22 +264,6 @@ out: return sub_info.retval; } -/* - * This is for the serialisation of device probe() functions - * against device open() functions - */ -static DECLARE_MUTEX(dev_probe_sem); - -void dev_probe_lock(void) -{ - down(&dev_probe_sem); -} - -void dev_probe_unlock(void) -{ - up(&dev_probe_sem); -} - EXPORT_SYMBOL(call_usermodehelper); #ifdef CONFIG_KMOD |
