From owner-svn-src-all@freebsd.org Tue Feb 6 16:02:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BCD3EE4129; Tue, 6 Feb 2018 16:02:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B212870F78; Tue, 6 Feb 2018 16:02: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91E441A18E; Tue, 6 Feb 2018 16:02: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 w16G2XBA051481; Tue, 6 Feb 2018 16:02:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16G2XlZ051480; Tue, 6 Feb 2018 16:02:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802061602.w16G2XlZ051480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Feb 2018 16:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328938 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 328938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2018 16:02:34 -0000 Author: markj Date: Tue Feb 6 16:02:33 2018 New Revision: 328938 URL: https://svnweb.freebsd.org/changeset/base/328938 Log: Simplify synchronization read error handling. Since synchronization reads are performed by submitting a request to the external mirror provider, we know that the request returns with an error only when gmirror was unable to read a copy of the block from any mirror. Thus, there is no need to retry the request from the synchronization error handler. 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 Tue Feb 6 16:02:25 2018 (r328937) +++ head/sys/geom/mirror/g_mirror.c Tue Feb 6 16:02:33 2018 (r328938) @@ -1336,9 +1336,7 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc */ switch (bp->bio_cmd) { case BIO_READ: { - struct g_mirror_disk *d; struct g_consumer *cp; - int readable; KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_sync_request_read, bp->bio_error); @@ -1349,31 +1347,17 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc bp->bio_error); /* - * If there's at least one other disk from which we can - * read the block, retry the request. - */ - readable = 0; - LIST_FOREACH(d, &sc->sc_disks, d_next) - if (d->d_state == G_MIRROR_DISK_STATE_ACTIVE && - !(d->d_flags & G_MIRROR_DISK_FLAG_BROKEN)) - readable++; - - /* * The read error will trigger a syncid bump, so there's * no need to do that here. * - * If we can retry the read from another disk, do so. - * Otherwise, all we can do is kick out the new disk. + * The read error handling for regular requests will + * retry the read from all active mirrors before passing + * the error back up, so there's no need to retry here. */ - if (readable == 0) { - g_mirror_sync_request_free(disk, bp); - g_mirror_event_send(disk, - G_MIRROR_DISK_STATE_DISCONNECTED, - G_MIRROR_EVENT_DONTWAIT); - } else { - g_mirror_sync_reinit(disk, bp, bp->bio_offset); - goto retry_read; - } + g_mirror_sync_request_free(disk, bp); + g_mirror_event_send(disk, + G_MIRROR_DISK_STATE_DISCONNECTED, + G_MIRROR_EVENT_DONTWAIT); return; } G_MIRROR_LOGREQ(3, bp, @@ -1429,7 +1413,6 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc g_mirror_sync_reinit(disk, bp, sync->ds_offset); sync->ds_offset += bp->bio_length; -retry_read: G_MIRROR_LOGREQ(3, bp, "Sending synchronization request."); sync->ds_consumer->index++;