Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Mar 2017 19:39:07 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r316175 - head/sys/geom/mirror
Message-ID:  <201703291939.v2TJd75n041466@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 			/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703291939.v2TJd75n041466>