aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2016-10-06 00:13:55 +0000
committerMark Johnston <markj@FreeBSD.org>2016-10-06 00:13:55 +0000
commit4dea20be45c33bc0b4a85e11811fb078395fe9e8 (patch)
treedc9b0b13fab5d623fd1baf38d720ea0822d8a3c2 /sys/geom
parent903618cd655ab060f92521dffe625303fac3739d (diff)
downloadsrc-4dea20be45c33bc0b4a85e11811fb078395fe9e8.tar.gz
src-4dea20be45c33bc0b4a85e11811fb078395fe9e8.zip
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
Notes
Notes: svn path=/head/; revision=306744
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/mirror/g_mirror.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index da4790edac2b..fb2aca9f14f7 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -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: