svn commit: r280746 - stable/10/usr.sbin/bhyve

Alexander Motin mav at FreeBSD.org
Fri Mar 27 08:55:55 UTC 2015


Author: mav
Date: Fri Mar 27 08:55:54 2015
New Revision: 280746
URL: https://svnweb.freebsd.org/changeset/base/280746

Log:
  MFC r280042: Close potential race on blockif_close().
  
  Reported by:	vangyzen

Modified:
  stable/10/usr.sbin/bhyve/block_if.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bhyve/block_if.c
==============================================================================
--- stable/10/usr.sbin/bhyve/block_if.c	Fri Mar 27 08:54:55 2015	(r280745)
+++ stable/10/usr.sbin/bhyve/block_if.c	Fri Mar 27 08:55:54 2015	(r280746)
@@ -579,7 +579,9 @@ blockif_close(struct blockif_ctxt *bc)
 	/*
 	 * Stop the block i/o thread
 	 */
+	pthread_mutex_lock(&bc->bc_mtx);
 	bc->bc_closing = 1;
+	pthread_mutex_unlock(&bc->bc_mtx);
 	pthread_cond_broadcast(&bc->bc_cond);
 	for (i = 0; i < BLOCKIF_NUMTHR; i++)
 		pthread_join(bc->bc_btid[i], &jval);


More information about the svn-src-all mailing list