From patchwork Fri Sep 17 16:18:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 65090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 617ABB70A6 for ; Sat, 18 Sep 2010 02:20:05 +1000 (EST) Received: from localhost ([127.0.0.1]:32852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwdfO-0000Io-Fz for incoming@patchwork.ozlabs.org; Fri, 17 Sep 2010 12:20:02 -0400 Received: from [140.186.70.92] (port=56675 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Owddr-0000Cb-Fb for qemu-devel@nongnu.org; Fri, 17 Sep 2010 12:18:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Owddk-0001W1-S6 for qemu-devel@nongnu.org; Fri, 17 Sep 2010 12:18:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44591) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Owddk-0001Vq-GY for qemu-devel@nongnu.org; Fri, 17 Sep 2010 12:18:20 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8HGIK6V030427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 17 Sep 2010 12:18:20 -0400 Received: from dhcp-5-188.str.redhat.com (vpn2-9-105.ams2.redhat.com [10.36.9.105]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8HGIEUd001945; Fri, 17 Sep 2010 12:18:18 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Fri, 17 Sep 2010 18:18:35 +0200 Message-Id: <1284740318-20838-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1284740318-20838-1-git-send-email-kwolf@redhat.com> References: <1284740318-20838-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH 1/4] qcow2: Move sync out of write_refcount_block_entries X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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; }