[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [Qemu-devel] [PATCH 1/3] block/qcow2: refactoring of t
From: |
Maxim Levitsky |
Subject: |
Re: [Qemu-stable] [Qemu-devel] [PATCH 1/3] block/qcow2: refactoring of threaded encryption code |
Date: |
Fri, 06 Sep 2019 22:03:40 +0300 |
On Fri, 2019-09-06 at 14:00 -0500, Eric Blake wrote:
> On 9/6/19 1:55 PM, Maxim Levitsky wrote:
>
> > > > +/*
> > > > + * qcow2_co_encrypt()
> > > > + *
> > > > + * Encrypts a sector size aligned contiguous area
> > > > + *
> > > > + * @host_cluster_offset - on disk offset of the cluster in which
> > > > + * the buffer resides
> > > > + *
> > > > + * @guest_offset - guest (virtual) offset of the buffer
> > > > + * @buf - buffer with the data to encrypt
> > > > + * @len - length of the buffer
> > > > + *
> > > > + * Note that the area is not cluster aligned and might cross a cluster
> > > > + * boundary
> > >
> > > Umm, how is it possible for a sector to cross a cluster boundary? All
> > > clusters are sector-aligned, and encryption only works on aligned
> > > sectors. Oh, I see - if @len is a multiple larger than sector size,
> > > then we have multiple sectors, and then indeed we may cross clusters.
> > > But then the docs about being 'a sector size aligned contiguous area' is
> > > not quite right.
> >
> > Why? the written area is always both aligned on _sector_ boundary
> > and multiple of the sector size. At least that what I see from
> > the existing asserts.
>
> I'm thinking it should read something like:
>
> Encrypts one or more contiguous aligned sectors
>
> to make it obvious that because there can be multiple sectors, there may
> indeed be a cluster boundary mid-length. My complaint was that the
> original text made it sound like there was exactly one sector (at which
> point @len is redundant, unless sectors are variably-sized)
>
I agree with you completely, I will change that.
Best regards,
Maxim Levitsky
[Qemu-stable] [PATCH 2/3] block/qcow2: fix the corruption when rebasing luks encrypted files, Maxim Levitsky, 2019/09/06
[Qemu-stable] [PATCH 3/3] qemu-iotests: test for bz #1745922, Maxim Levitsky, 2019/09/06
Re: [Qemu-stable] [Qemu-devel] [PATCH 0/3] Fix qcow2+luks corruption introduced by commit 8ac0f15f335, Maxim Levitsky, 2019/09/06