Message ID | 1361288706-13929-2-git-send-email-stefanha@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index bc1784c..05b5ec9 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -237,7 +237,7 @@ static int alloc_refcount_block(BlockDriverState *bs, goto fail_block; } - bdrv_flush(bs->file); + qcow2_cache_flush(bs, s->refcount_block_cache); /* Initialize the new refcount block only after updating its refcount, * update_refcount uses the refcount cache itself */
update_refcount() affects the refcount cache, it does not write to disk. Therefore bdrv_flush(bs->file) does nothing. We need to flush the refcount cache in order to write out the refcount updates! Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> --- block/qcow2-refcount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)