datapath: Acquire dp->mutex when deleting a datapath.
authorJesse Gross <jesse@nicira.com>
Wed, 29 Dec 2010 21:09:56 +0000 (13:09 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 30 Dec 2010 17:28:00 +0000 (09:28 -0800)
commitb0fb95ac4b36de9b03405dfb0883e69cee8d2fb3
tree98db7f134c5be1269cda07c9408a27479dbdadf7
parent8f843b6f0fc45fdba373024aaa759785938858fc
datapath: Acquire dp->mutex when deleting a datapath.

It's possible that someone is using the datapath data structures
when we attempt to delete the datapath.  The first writer will
only hold dp->mutex, which we don't currently acquire when deleting.
This adds that lock to prevent a potential race (this can't currently
happen because userspace is single threaded, as long as "ovs-dpctl
del-dp" is not used at the same time).

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/datapath.c