Received: from eggs.gnu.org ([2001:4830:134:3::10]:41662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOS7R-0003L2-IT for qemu-devel@nongnu.org; Tue, 24 Sep 2013 08:53:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOS7J-0007Lb-5B for qemu-devel@nongnu.org; Tue, 24 Sep 2013 08:53:33 -0400 Received: from mail-ea0-x231.google.com ([2a00:1450:4013:c01::231]:41254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOS7I-0007LV-VE for qemu-devel@nongnu.org; Tue, 24 Sep 2013 08:53:25 -0400 Received: by mail-ea0-f177.google.com with SMTP id f15so2409654eak.8 for ; Tue, 24 Sep 2013 05:53:24 -0700 (PDT) Date: Tue, 24 Sep 2013 14:53:21 +0200 From: Stefan Hajnoczi Message-ID: <20130924125321.GC12579@stefanha-thinkpad.redhat.com> References: <1379927909-32609-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1379927909-32609-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] vmdk: fix cluster size check for flat extents List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Mon, Sep 23, 2013 at 05:18:29PM +0800, Fam Zheng wrote: > We use the extent size as cluster size for flat extents (where no L1/L2 > table is allocated so it's safe) reuse sector calculating code with > sparse extents. > > Don't pass in the cluster size for adding flat extent, just set it to > sectors later, then the cluster size checking will not fail. This is a little hacky, the next person that modifies vmdk may not be aware of this trick. I would avoid using ->cluster_sectors at all with flat extents. But I didn't investigate how feasible that approach is... Reviewed-by: Stefan Hajnoczi