From: Eric Blake <eblake@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH] qcow2: Document and enforce the QCowL2Meta invariants
Date: Wed, 7 Oct 2020 09:34:04 -0500 [thread overview]
Message-ID: <21d332f9-5174-f552-ff07-8109b3673c52@redhat.com> (raw)
In-Reply-To: <20201007115217.18013-1-berto@igalia.com>
[-- Attachment #1.1: Type: text/plain, Size: 2028 bytes --]
On 10/7/20 6:52 AM, Alberto Garcia wrote:
> The QCowL2Meta structure is used to store information about a part of
> a write request that touches clusters that need changes in their L2
> entries. This happens with newly-allocated clusters or subclusters.
>
> This structure has changed a bit since it was first created and its
> current documentation is not quite up-to-date.
>
> A write request can span a region consisting on a combination of
s/on/of/
> clusters of different types, and qcow2_alloc_host_offset() can
> repeatedly call handle_copied() and handle_alloc() to add more
> clusters to the mix as long as they all are contiguous on the image
> file.
>
> Because of this a write request has a list of QCowL2Meta structures,
> one for each part of the request that needs changes in the L2
> metadata.
>
> Each one of them spans nb_clusters and has two copy-on-write regions
> located immediately before and after the middle region that that part
> of the write request touches. Even when those regions themselves are
Grammatically correct, but the doubled 'that' caught me on my first
read. Maybe you want:
s/that that part of the write request touches/touched by that part of
the write request/
> empty their offsets must be correct because they are used to know the
> location of the middle region.
>
> This was not always the case but it is not a problem anymore
> because the only two places where QCowL2Meta structures are created
> (calculate_l2_meta() and qcow2_co_truncate()) ensure that the
> copy-on-write regions are correctly defined, and so do assertions like
> the ones in perform_cow().
>
> The conditional initialization of the 'written_to' variable is
> therefore unnecessary and is removed by this patch.
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-10-07 14:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-07 11:52 [PATCH] qcow2: Document and enforce the QCowL2Meta invariants Alberto Garcia
2020-10-07 14:34 ` Eric Blake [this message]
2020-10-07 14:42 ` Vladimir Sementsov-Ogievskiy
2020-10-07 15:38 ` Alberto Garcia
2020-10-07 15:47 ` Vladimir Sementsov-Ogievskiy
2020-10-07 16:03 ` Alberto Garcia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21d332f9-5174-f552-ff07-8109b3673c52@redhat.com \
--to=eblake@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).