From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUeIb-0007SM-Jw for qemu-devel@nongnu.org; Fri, 11 Oct 2013 11:06:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUeIU-0005JX-Sz for qemu-devel@nongnu.org; Fri, 11 Oct 2013 11:06:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUeIU-0005JR-G5 for qemu-devel@nongnu.org; Fri, 11 Oct 2013 11:06:34 -0400 From: Kevin Wolf Date: Fri, 11 Oct 2013 17:05:12 +0200 Message-Id: <1381503951-27985-23-git-send-email-kwolf@redhat.com> In-Reply-To: <1381503951-27985-1-git-send-email-kwolf@redhat.com> References: <1381503951-27985-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 22/61] qcow2: Remove wrong metadata overlap check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Max Reitz In qcow2_write_compressed, if the compression fails, a normal cluster is written to disk. This is done through bdrv_write on the qcow2 BDS itself (using the guest offset), thus it is wrong to do a metadata overlap check before. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- block/qcow2.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 9095f7c..3d1e74d 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1738,14 +1738,6 @@ static int qcow2_write_compressed(BlockDriverState *bs, int64_t sector_num, if (ret != Z_STREAM_END || out_len >= s->cluster_size) { /* could not compress: write normal cluster */ - - ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_DEFAULT, - sector_num * BDRV_SECTOR_SIZE, - s->cluster_sectors * BDRV_SECTOR_SIZE); - if (ret < 0) { - goto fail; - } - ret = bdrv_write(bs, sector_num, buf, s->cluster_sectors); if (ret < 0) { goto fail; -- 1.8.1.4