From: Maxim Levitsky <mlevitsk@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
qemu-stable <qemu-stable@nongnu.org>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
"Max Reitz" <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 1/3] block/qcow2: refactoring of threaded encryption code
Date: Fri, 13 Sep 2019 17:07:56 +0300 [thread overview]
Message-ID: <5fdc4891c02c7977762bb76fd877e4383e04be0c.camel@redhat.com> (raw)
In-Reply-To: <5d578974-d02d-8b05-8d51-85715d1d4468@virtuozzo.com>
On Fri, 2019-09-13 at 14:01 +0000, Vladimir Sementsov-Ogievskiy wrote:
> 13.09.2019 15:59, Maxim Levitsky wrote:
> > This commit tries to clarify few function arguments,
> > and add comments describing the encrypt/decrypt interface
> >
> > Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
> > ---
> > block/qcow2-cluster.c | 9 ++++---
> > block/qcow2-threads.c | 62 ++++++++++++++++++++++++++++++++++---------
> > block/qcow2.c | 5 ++--
> > block/qcow2.h | 8 +++---
> > 4 files changed, 61 insertions(+), 23 deletions(-)
> >
> > diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
> > index f09cc992af..46b0854d7e 100644
> > --- a/block/qcow2-cluster.c
> > +++ b/block/qcow2-cluster.c
> > @@ -463,8 +463,8 @@ static int coroutine_fn do_perform_cow_read(BlockDriverState *bs,
> > }
> >
> > static bool coroutine_fn do_perform_cow_encrypt(BlockDriverState *bs,
> > - uint64_t src_cluster_offset,
> > - uint64_t cluster_offset,
> > + uint64_t guest_cluster_offset,
> > + uint64_t host_cluster_offset,
> > unsigned offset_in_cluster,
> > uint8_t *buffer,
> > unsigned bytes)
> > @@ -474,8 +474,9 @@ static bool coroutine_fn do_perform_cow_encrypt(BlockDriverState *bs,
> > assert((offset_in_cluster & ~BDRV_SECTOR_MASK) == 0);
> > assert((bytes & ~BDRV_SECTOR_MASK) == 0);
> > assert(s->crypto);
> > - if (qcow2_co_encrypt(bs, cluster_offset,
> > - src_cluster_offset + offset_in_cluster,
> > + if (qcow2_co_encrypt(bs,
> > + host_cluster_offset + offset_in_cluster,
> > + guest_cluster_offset + offset_in_cluster,
>
> oops, seems you accidentally fixed the bug, which you are going to fix in the next
> patch, as now correct offsets are given to qcow2_co_encrypt :)
>
> and next patch no is a simple no-logic-change refactoring, so at least commit message
> should be changed.
Yep :-( I am trying my best in addition to fixing the bug, also clarify the area to
avoid this from happening again.
What do you think that I fold these two patches together after all?
Best regards,
Maxim Levitsky
next prev parent reply other threads:[~2019-09-13 14:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-13 12:59 [Qemu-devel] [PATCH v4 0/3] Fix qcow2+luks corruption introduced by commit 8ac0f15f335 Maxim Levitsky
2019-09-13 12:59 ` [Qemu-devel] [PATCH v4 1/3] block/qcow2: refactoring of threaded encryption code Maxim Levitsky
2019-09-13 14:01 ` Vladimir Sementsov-Ogievskiy
2019-09-13 14:07 ` Maxim Levitsky [this message]
2019-09-13 14:21 ` Vladimir Sementsov-Ogievskiy
2019-09-13 14:24 ` Kevin Wolf
2019-09-13 14:37 ` Maxim Levitsky
2019-09-13 14:44 ` Vladimir Sementsov-Ogievskiy
2019-09-13 14:51 ` Kevin Wolf
2019-09-13 14:46 ` Kevin Wolf
2019-09-13 12:59 ` [Qemu-devel] [PATCH v4 2/3] block/qcow2: fix the corruption when rebasing luks encrypted files Maxim Levitsky
2019-09-13 12:59 ` [Qemu-devel] [PATCH v4 3/3] qemu-iotests: Add test for bz #1745922 Maxim Levitsky
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=5fdc4891c02c7977762bb76fd877e4383e04be0c.camel@redhat.com \
--to=mlevitsk@redhat.com \
--cc=berrange@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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).