]> git.baikalelectronics.ru Git - kernel.git/commit
veth: fix dev refcount race
authorDaniel Lezcano <dlezcano@fr.ibm.com>
Wed, 20 Feb 2008 08:21:47 +0000 (00:21 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Feb 2008 08:21:47 +0000 (00:21 -0800)
commit967ea272f64d6cfe80877318478774a6d9391846
tree0f5735eb9c3fedc715f58d4aeeeed162eabb5d3a
parent82a2db8498ecc737251d38fdd3e0f07c84cbd3e2
veth: fix dev refcount race

When deleting the veth driver, veth_close calls netif_carrier_off
for the two extremities of the network device. netif_carrier_off on
the peer device will fire an event and hold a reference on the peer
device. Just after, the peer is unregistered taking the rtnl_lock while
the linkwatch_event is scheduled. If __linkwatch_run_queue does not
occurs before the unregistering, unregister_netdevice will wait for
the dev refcount to reach zero holding the rtnl_lock and linkwatch_event
will wait for the rtnl_lock and hold the dev refcount.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/veth.c