diff options
author | Jesse Gross <jesse@nicira.com> | 2010-04-26 18:08:54 -0700 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2010-04-30 17:23:44 -0700 |
commit | d8b5d43a04fba8ba09d5bb3c745808964f371d80 (patch) | |
tree | a0a0f9af4566c51a84b97b35fa46532b3d96fcd7 /datapath/vport-internal_dev.c | |
parent | 59a81d829017956100170f9499dc690613fc1f6f (diff) |
datapath: Don't hold dp_mutex when setting internal devs MTU.
We currently acquire dp_mutex when we are notified that the MTU
of a device attached to the datapath has changed so that we can
set the internal devices to the minimum MTU. However, it is not
required to hold dp_mutex because we already have RTNL lock and it
causes a deadlock, so don't do it.
Specifically, the issue is that DP mutex is acquired twice: once in
dp_device_event() before calling set_internal_devs_mtu() and then
again in internal_dev_change_mtu() when it is actually being changed
(since the MTU can also be set directly). Since it's not a recursive
mutex, deadlock.
Diffstat (limited to 'datapath/vport-internal_dev.c')
-rw-r--r-- | datapath/vport-internal_dev.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index 39283e05..88b6cc19 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -144,13 +144,7 @@ static int internal_dev_change_mtu(struct net_device *netdev, int new_mtu) return -EINVAL; if (dp_port) { - int min_mtu; - - mutex_lock(&dp_port->dp->mutex); - min_mtu = dp_min_mtu(dp_port->dp); - mutex_unlock(&dp_port->dp->mutex); - - if (new_mtu > min_mtu) + if (new_mtu > dp_min_mtu(dp_port->dp)) return -EINVAL; } |