From owner-svn-src-head@freebsd.org Thu Oct 6 00:13:56 2016 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 B81F4AF44B4; Thu, 6 Oct 2016 00:13:56 +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 8862FAC7; Thu, 6 Oct 2016 00:13:56 +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 u960Dt0K087721; Thu, 6 Oct 2016 00:13:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u960Dtew087720; Thu, 6 Oct 2016 00:13:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201610060013.u960Dtew087720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Oct 2016 00:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306744 - 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: Thu, 06 Oct 2016 00:13:56 -0000 Author: markj Date: Thu Oct 6 00:13:55 2016 New Revision: 306744 URL: https://svnweb.freebsd.org/changeset/base/306744 Log: gmirror: Write an updated syncid before queuing writes. When a syncid bump is pending, any write to the mirror results in the updated syncid being written to each component's metadata block. However, the update was only being performed after the writes to the mirror componenents were queued. Instead, synchronously update the metadata block first. MFC after: 3 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 Thu Oct 6 00:05:45 2016 (r306743) +++ head/sys/geom/mirror/g_mirror.c Thu Oct 6 00:13:55 2016 (r306744) @@ -1676,6 +1676,14 @@ g_mirror_register_request(struct bio *bp sc->sc_last_write = time_uptime; /* + * Bump syncid on first write. + */ + if ((sc->sc_bump_id & G_MIRROR_BUMP_SYNCID) != 0) { + sc->sc_bump_id &= ~G_MIRROR_BUMP_SYNCID; + g_mirror_bump_syncid(sc); + } + + /* * Allocate all bios before sending any request, so we can * return ENOMEM in nice and clean way. */ @@ -1730,13 +1738,6 @@ g_mirror_register_request(struct bio *bp * synchronization requests don't collide with it. */ bioq_insert_tail(&sc->sc_inflight, bp); - /* - * Bump syncid on first write. - */ - if ((sc->sc_bump_id & G_MIRROR_BUMP_SYNCID) != 0) { - sc->sc_bump_id &= ~G_MIRROR_BUMP_SYNCID; - g_mirror_bump_syncid(sc); - } return; } default: