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

Mark Johnston markj at FreeBSD.org
Fri Apr 14 17:03:33 UTC 2017


Author: markj
Date: Fri Apr 14 17:03:32 2017
New Revision: 316866
URL: https://svnweb.freebsd.org/changeset/base/316866

Log:
  Check for a provider error before enqueuing mirror I/O.
  
  We are otherwise susceptible to a race with a concurrent teardown of the
  mirror provider, causing the I/O to be left uncompleted after the mirror
  started withering.
  
  Tested by:	pho
  MFC after:	2 weeks
  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	Fri Apr 14 17:02:24 2017	(r316865)
+++ head/sys/geom/mirror/g_mirror.c	Fri Apr 14 17:03:32 2017	(r316866)
@@ -1176,6 +1176,11 @@ g_mirror_start(struct bio *bp)
 		return;
 	}
 	mtx_lock(&sc->sc_queue_mtx);
+	if (bp->bio_to->error != 0) {
+		mtx_unlock(&sc->sc_queue_mtx);
+		g_io_deliver(bp, bp->bio_to->error);
+		return;
+	}
 	bioq_insert_tail(&sc->sc_queue, bp);
 	mtx_unlock(&sc->sc_queue_mtx);
 	G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc);


More information about the svn-src-head mailing list