From: Paolo Bonzini Date: Thu, 29 Jun 2017 13:27:39 +0000 (+0200) Subject: qcow2: call CoQueue APIs under CoMutex X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a8c57408cd5443186c5b1c7a393702b316d4722b;p=qemu.git qcow2: call CoQueue APIs under CoMutex Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini Message-Id: <20170629132749.997-2-pbonzini@redhat.com> Signed-off-by: Fam Zheng --- diff --git a/block/qcow2.c b/block/qcow2.c index c144ea5620..d5790af1e0 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2025,8 +2025,6 @@ static coroutine_fn int qcow2_co_pwritev(BlockDriverState *bs, uint64_t offset, ret = 0; fail: - qemu_co_mutex_unlock(&s->lock); - while (l2meta != NULL) { QCowL2Meta *next; @@ -2040,6 +2038,8 @@ fail: l2meta = next; } + qemu_co_mutex_unlock(&s->lock); + qemu_iovec_destroy(&hd_qiov); qemu_vfree(cluster_data); trace_qcow2_writev_done_req(qemu_coroutine_self(), ret);