[ovs-dev] [PATCH 4/7] datapath: Hold dp->mutex when calling new_vport().
jesse at nicira.com
Thu Dec 30 09:36:45 PST 2010
On Thu, Dec 30, 2010 at 12:29 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Wed, Dec 29, 2010 at 03:41:32PM -0800, Jesse Gross wrote:
>> On datapath creation we hold dp_mutex but not dp->mutex when
>> creating the vport for the datapath device. However, there are
>> lockdep checks that validate that we hold dp->mutex during the call
>> to new_vport(). The lock isn't actually necessary in this case
>> because no one else can access the datapath but it's good to have
>> the lock assertions, so this wraps the call to new_vport() with
>> Found with lockdep.
>> Signed-off-by: Jesse Gross <jesse at nicira.com>
> I'd be tempted to take the mutex as soon as we initialize it. It would
> be more obviously correct, I think.
That's reasonable. I made that change.
More information about the dev