From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUz3o-00081B-9B for qemu-devel@nongnu.org; Tue, 01 Apr 2014 09:49:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUz3i-0000A8-LY for qemu-devel@nongnu.org; Tue, 01 Apr 2014 09:49:04 -0400 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:42380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUz3i-00009b-F6 for qemu-devel@nongnu.org; Tue, 01 Apr 2014 09:48:58 -0400 Received: by mail-wi0-f171.google.com with SMTP id q5so5193296wiv.10 for ; Tue, 01 Apr 2014 06:48:57 -0700 (PDT) Date: Tue, 1 Apr 2014 15:48:54 +0200 From: Stefan Hajnoczi Message-ID: <20140401134854.GA7972@stefanha-thinkpad.redhat.com> References: <1396343577-10563-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1396343577-10563-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.0] qcow2: link all L2 meta updates in preallocate() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-devel@nongnu.org On Tue, Apr 01, 2014 at 11:12:57AM +0200, Stefan Hajnoczi wrote: > preallocate() only links the first QCowL2Meta's data clusters into the > L2 table and ignores any chained QCowL2Metas in the linked list. > > Chains of QCowL2Meta structs are built up when contiguous clusters span > L2 tables. Each QCowL2Meta describes one L2 table update. This is a > rare case in preallocate() but can happen. > > This patch fixes preallocate() by iterating over the whole list of > QCowL2Metas. Compare with the qcow2_co_writev() function's > implementation, which is similar but also also handles request > dependencies. preallocate() only performs one allocation at a time so > there can be no dependencies. > > Signed-off-by: Stefan Hajnoczi > --- > block/qcow2.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) Discussed with Kevin and applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan