Received: from eggs.gnu.org ([2001:4830:134:3::10]:57176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZivA-0002xF-7d for qemu-devel@nongnu.org; Wed, 09 Sep 2015 13:12:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZiv6-0000IB-6O for qemu-devel@nongnu.org; Wed, 09 Sep 2015 13:12:32 -0400 Date: Wed, 9 Sep 2015 19:12:20 +0200 From: Kevin Wolf Message-ID: <20150909171220.GG4860@noname.redhat.com> References: <1441814987-27121-1-git-send-email-mreitz@redhat.com> <1441814987-27121-2-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1441814987-27121-2-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 1/2] qcow2: Make size_to_clusters() return uint64_t List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org Am 09.09.2015 um 18:09 hat Max Reitz geschrieben: > Sadly, some images may have more clusters than what can be represented > using a plain int. We should be prepared for that case (in > qcow2_check_refcounts() we actually were trying to catch that case, but > since size_to_clusters() truncated the returned value, that check never > did anything useful). > > Cc: qemu-stable > Signed-off-by: Max Reitz > @@ -840,7 +843,7 @@ err: > static int count_cow_clusters(BDRVQcow2State *s, int nb_clusters, > uint64_t *l2_table, int l2_index) > { > - int i; > + uint64_t i; > > for (i = 0; i < nb_clusters; i++) { > uint64_t l2_entry = be64_to_cpu(l2_table[l2_index + i]); As discussed on IRC, I removed this hunk, which isn't needed in v2. Thanks, applied all to the block branch. Kevin