[ovs-git] Open vSwitch: ofproto-dpif-upcall: Fix a race. (master)

dev at openvswitch.org dev at openvswitch.org
Fri Mar 28 16:21:04 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  5878877a75a11d9e73f61cebfa18ff84dcdd64ba (commit)
      from  c3ccfe984933ca8df56d551cb3ae7e0bf3d119b8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5878877a75a11d9e73f61cebfa18ff84dcdd64ba
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=5878877a75a11d9e73f61cebfa18ff84dcdd64ba
Author: Alex Wang <alexw at nicira.com>
		
ofproto-dpif-upcall: Fix a race.
		
Commit 61057e884ca9c(ofproto-dpif-upcall: Slightly simplify
udpif_upcall_handler().) restructured the main loop in
udpif_upcall_handler() and discarded the check for the
'exit_latch' after acquiring the mutex.  This makes it
possible for the following race:

- main thread sets the 'exit_latch' after the handler thread
  checking it.
- main thread acquires the handler thread mutex and signals the
  condition variable of handler thread.
- main thread releases the mutex and 'join' the handler thread.
- handler thread acquires the mutex, finds that n_upcalls is 0
  and waits on the signal of condition variable.
- then OVS will hang forever.

This commit fixes the above issue by adding a check for the
'exit_latch' after acquiring the mutex.

Bug #1217229

Signed-off-by: Alex Wang <alexw at nicira.com>
Acked-by: Ethan Jackson <ethan at nicira.com>


-----------------------------------------------------------------------

Summary of changes:
 ofproto/ofproto-dpif-upcall.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list