Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2017 17:03:32 +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: r316866 - head/sys/geom/mirror
Message-ID:  <201704141703.v3EH3W5H035122@repo.freebsd.org>

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



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