From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49448 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oy4fU-0008L7-Cl for qemu-devel@nongnu.org; Tue, 21 Sep 2010 11:22:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oy4fN-0005s8-4U for qemu-devel@nongnu.org; Tue, 21 Sep 2010 11:21:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11174) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oy4fM-0005rc-Sc for qemu-devel@nongnu.org; Tue, 21 Sep 2010 11:21:57 -0400 From: Kevin Wolf Date: Tue, 21 Sep 2010 17:21:50 +0200 Message-Id: <1285082522-24407-9-git-send-email-kwolf@redhat.com> In-Reply-To: <1285082522-24407-1-git-send-email-kwolf@redhat.com> References: <1285082522-24407-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 08/20] qcow2: Move sync out of write_refcount_block_entries List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org Signed-off-by: Kevin Wolf --- block/qcow2-refcount.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 4c19e7e..7dc75d1 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -444,7 +444,7 @@ static int write_refcount_block_entries(BlockDriverState *bs, size = (last_index - first_index) << REFCOUNT_SHIFT; BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_UPDATE_PART); - ret = bdrv_pwrite_sync(bs->file, + ret = bdrv_pwrite(bs->file, refcount_block_offset + (first_index << REFCOUNT_SHIFT), &s->refcount_block_cache[first_index], size); if (ret < 0) { @@ -551,6 +551,8 @@ fail: dummy = update_refcount(bs, offset, cluster_offset - offset, -addend); } + bdrv_flush(bs->file); + return ret; } -- 1.7.2.2