datapath: Don't hold dp_mutex when setting internal devs MTU.
authorJesse Gross <jesse@nicira.com>
Tue, 27 Apr 2010 01:08:54 +0000 (18:08 -0700)
committerJesse Gross <jesse@nicira.com>
Sat, 1 May 2010 00:23:44 +0000 (17:23 -0700)
commitd8b5d43a04fba8ba09d5bb3c745808964f371d80
treea0a0f9af4566c51a84b97b35fa46532b3d96fcd7
parent59a81d829017956100170f9499dc690613fc1f6f
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.
datapath/datapath.c
datapath/dp_notify.c
datapath/vport-internal_dev.c