block/mirror: Revive dead yielding code
authorMax Reitz <mreitz@redhat.com>
Tue, 19 Apr 2016 22:59:47 +0000 (00:59 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 20 Apr 2016 14:52:55 +0000 (16:52 +0200)
commit9c83625bdd3c1900d304058ece152040ef5d1ead
tree5e9e0b0ac950fd5c988096721ba1567cc752e38a
parent4113b0532da6c448f8e458b413ebde035234d0ea
block/mirror: Revive dead yielding code

mirror_iteration() is supposed to wait if the current chunk is subject
to a still in-flight mirroring operation. However, it mixed checking
this conflict situation with checking the dirty status of a chunk. A
simplification for the latter condition (the first chunk encountered is
always dirty) led to neglecting the former: We just skip the first chunk
and thus never test whether it conflicts with an in-flight operation.

To fix this, pull out the code which waits for in-flight operations on
the first chunk of the range to be mirrored to settle.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/mirror.c