svn commit: r316175 - head/sys/geom/mirror

Mark Johnston markj at FreeBSD.org
Wed Mar 29 19:39:08 UTC 2017


Author: markj
Date: Wed Mar 29 19:39:07 2017
New Revision: 316175
URL: https://svnweb.freebsd.org/changeset/base/316175

Log:
  Avoid sleeping when the mirror I/O queue is non-empty.
  
  A request may be queued while the queue lock is dropped when the mirror is
  being destroyed. The corresponding wakeup would be lost, possibly resulting
  in an apparent hang of the mirror worker thread.
  
  Tested by:	pho (part of a larger patch)
  MFC after:	1 week
  Sponsored by:	Dell EMC Isilon

Modified:
  head/sys/geom/mirror/g_mirror.c

Modified: head/sys/geom/mirror/g_mirror.c
==============================================================================
--- head/sys/geom/mirror/g_mirror.c	Wed Mar 29 19:30:22 2017	(r316174)
+++ head/sys/geom/mirror/g_mirror.c	Wed Mar 29 19:39:07 2017	(r316175)
@@ -1917,6 +1917,10 @@ g_mirror_worker(void *arg)
 					kproc_exit(0);
 				}
 				mtx_lock(&sc->sc_queue_mtx);
+				if (bioq_first(&sc->sc_queue) != NULL) {
+					mtx_unlock(&sc->sc_queue_mtx);
+					continue;
+				}
 			}
 			sx_xunlock(&sc->sc_lock);
 			/*


More information about the svn-src-head mailing list