@@ -2962,7 +2962,11 @@ static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src,
if (!(flags & BDRV_REQ_NO_SERIALISING)) {
wait_serialising_requests(&src_req);
- wait_serialising_requests(&dst_req);
+ }
+
+ ret = bdrv_co_write_req_prepare(dst, &dst_req, flags);
+ if (ret) {
+ goto out;
}
if (recurse_src) {
ret = src->bs->drv->bdrv_co_copy_range_from(src->bs,
@@ -2975,6 +2979,8 @@ static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src,
dst, dst_offset,
bytes, flags);
}
+out:
+ bdrv_co_write_req_finish(dst, &dst_req, ret);
tracked_request_end(&src_req);
tracked_request_end(&dst_req);
bdrv_dec_in_flight(src->bs);
This brings the request handling logic inline with write and discard, fixing write_gen, resize_cb, dirty bitmaps and image size refreshing. The last of these issues broke iotest case 222, which is now fixed. Signed-off-by: Fam Zheng <famz@redhat.com> --- block/io.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)