From owner-svn-src-head@freebsd.org Fri Apr 14 17:03:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A04F7D3D0D5; Fri, 14 Apr 2017 17:03:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7271AC43; Fri, 14 Apr 2017 17:03:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EH3WnY035123; Fri, 14 Apr 2017 17:03:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3EH3W5H035122; Fri, 14 Apr 2017 17:03:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704141703.v3EH3W5H035122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 14 Apr 2017 17:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316866 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 17:03:33 -0000 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);