From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC7W1-000604-V7 for qemu-devel@nongnu.org; Tue, 29 Jul 2014 09:32:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XC7Vv-0001VI-Mm for qemu-devel@nongnu.org; Tue, 29 Jul 2014 09:32:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC7Vv-0001V5-Ep for qemu-devel@nongnu.org; Tue, 29 Jul 2014 09:32:23 -0400 Date: Tue, 29 Jul 2014 21:32:42 +0800 From: Fam Zheng Message-ID: <20140729133242.GD16854@T430.nay.redhat.com> References: <1401180562-29680-1-git-send-email-famz@redhat.com> <1401180562-29680-3-git-send-email-famz@redhat.com> <20140728151110.GG13872@stefanha-thinkpad.redhat.com> <20140729010043.GA6544@T430.nay.redhat.com> <20140729125144.GA25860@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140729125144.GA25860@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 2/2] vmdk: Optimize cluster allocation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org On Tue, 07/29 13:51, Stefan Hajnoczi wrote: > On Tue, Jul 29, 2014 at 09:00:43AM +0800, Fam Zheng wrote: > > On Mon, 07/28 16:11, Stefan Hajnoczi wrote: > > > On Tue, May 27, 2014 at 04:49:22PM +0800, Fam Zheng wrote: > > > > + if (!bs->backing_hd) { > > > > + memset(whole_grain, 0, skip_start_sector << BDRV_SECTOR_BITS); > > > > + memset(whole_grain + (skip_end_sector << BDRV_SECTOR_BITS), 0, > > > > + cluster_bytes - (skip_end_sector << BDRV_SECTOR_BITS)); > > > > + } > > > > + > > > > + assert(skip_end_sector <= sector_num + extent->cluster_sectors); > > > > > > Does this assertion make sense? skip_end_sector is a small number of > > > sectors (relative to start of cluster), while sector_num + > > > extent->cluster_sectors is a large absolute sector offset. > > > > skip_end_sector is absolute sector number too. The caller hunk in this patch > > is: > > I disagree. You are right, I totally misread when replying. Will respin to fix the assertion and also the spellings. Thanks for reviewing and explaining my mistake :) Fam