From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMyGH-0002gy-I1 for qemu-devel@nongnu.org; Fri, 20 Sep 2013 06:48:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMyGC-0006Aq-Pu for qemu-devel@nongnu.org; Fri, 20 Sep 2013 06:48:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMyGC-0006Am-IC for qemu-devel@nongnu.org; Fri, 20 Sep 2013 06:48:28 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8KAmRVY026375 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 20 Sep 2013 06:48:27 -0400 Date: Fri, 20 Sep 2013 12:48:26 +0200 From: Stefan Hajnoczi Message-ID: <20130920104826.GA14738@stefanha-thinkpad.redhat.com> References: <1379586555-1479-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1379586555-1479-1-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH] qcow2: Correct snapshots size for overlap check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org On Thu, Sep 19, 2013 at 12:29:15PM +0200, Max Reitz wrote: > Using s->snapshots_size instead of snapshots_size for the metadata > overlap check in qcow2_write_snapshots leads to the detection of an > overlap with the main qcow2 image header when deleting the last > snapshot, since s->snapshots_size has not yet been updated and is > therefore non-zero. However, the offset returned by qcow2_alloc_clusters > will be zero since snapshots_size is zero. Therefore, an overlap is > detected albeit no such will occur. > > This patch fixes this by replacing s->snapshots_size by snapshots_size > when calling qcow2_pre_write_overlap_check. > > Signed-off-by: Max Reitz > --- > block/qcow2-snapshot.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan