Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Oct 2016 00:13:55 +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: r306744 - head/sys/geom/mirror
Message-ID:  <201610060013.u960Dtew087720@repo.freebsd.org>

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



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