qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: fix qcow2_co_flush deadlock
@ 2011-10-27  9:22 Dong Xu Wang
  2011-10-27  9:46 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Dong Xu Wang @ 2011-10-27  9:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, wdongxu, stefanha, Dong Xu Wang

If qcow2_cache_flush failed, s->lock will not be unlock.

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
---
 block/qcow2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index a181932..ef057d3 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1113,11 +1113,13 @@ static int qcow2_co_flush(BlockDriverState *bs)
     qemu_co_mutex_lock(&s->lock);
     ret = qcow2_cache_flush(bs, s->l2_table_cache);
     if (ret < 0) {
+        qemu_co_mutex_unlock(&s->lock);
         return ret;
     }
 
     ret = qcow2_cache_flush(bs, s->refcount_block_cache);
     if (ret < 0) {
+        qemu_co_mutex_unlock(&s->lock);
         return ret;
     }
     qemu_co_mutex_unlock(&s->lock);
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] block: fix qcow2_co_flush deadlock
  2011-10-27  9:22 [Qemu-devel] [PATCH] block: fix qcow2_co_flush deadlock Dong Xu Wang
@ 2011-10-27  9:46 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2011-10-27  9:46 UTC (permalink / raw)
  To: Dong Xu Wang; +Cc: pbonzini, wdongxu, qemu-devel, stefanha

Am 27.10.2011 11:22, schrieb Dong Xu Wang:
> If qcow2_cache_flush failed, s->lock will not be unlock.
> 
> Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-27 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-27  9:22 [Qemu-devel] [PATCH] block: fix qcow2_co_flush deadlock Dong Xu Wang
2011-10-27  9:46 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).