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
This commit is contained in:
markj 2016-10-06 00:13:55 +00:00
parent 780b5bd00e
commit 8c59e4b664

View File

@ -1675,6 +1675,14 @@ g_mirror_register_request(struct bio *bp)
else
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: