qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH for-4.2 0/2] qcow2: Fix QCOW2_COMPRESSED_SECTOR_MASK
Date: Wed, 6 Nov 2019 12:19:17 +0100	[thread overview]
Message-ID: <dc66ebe6-8e33-ce74-c408-7a57ee4f8331@redhat.com> (raw)
In-Reply-To: <20191028161841.1198-1-mreitz@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1549 bytes --]

On 28.10.19 17:18, Max Reitz wrote:
> This fixes a bug reported on
> https://bugs.launchpad.net/qemu/+bug/1850000.  The problem is that
> QCOW2_COMPRESSED_SECTOR_MASK is a 32-bit mask when it really needs to be
> a 64-bit mask.
> 
> The launchpad report mentions only problems with qemu-img check on large
> compressed images, but I think it might extend further than that:
> - I suppose qcow2_free_any_clusters() would free every compressed offset
>   modulo 4G, which isn’t good
> - qcow2_update_snapshot_refcount() will probably update compressed
>   cluster’s refcounts (in snapshots) modulo 4G, which also isn’t good
> - And then we have check_refcount_l2() which updates the wrong clusters
>   for qemu-img check (as demonstrated in the bug report)
> 
> - (qcow2_co_preadv_compressed() is safe because it uses the inverted
>   mask, which of course is again just 32 bit)
> 
> 
> But I haven’t tested those other cases.
> 
> 
> Max Reitz (2):
>   qcow2: Fix QCOW2_COMPRESSED_SECTOR_MASK
>   iotests: Add test for 4G+ compressed qcow2 write
> 
>  block/qcow2.h              |  2 +-
>  tests/qemu-iotests/272     | 79 ++++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/272.out | 10 +++++
>  tests/qemu-iotests/group   |  1 +
>  4 files changed, 91 insertions(+), 1 deletion(-)
>  create mode 100755 tests/qemu-iotests/272
>  create mode 100644 tests/qemu-iotests/272.out

Thanks for the review, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2019-11-06 11:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28 16:18 [PATCH for-4.2 0/2] qcow2: Fix QCOW2_COMPRESSED_SECTOR_MASK Max Reitz
2019-10-28 16:18 ` [PATCH for-4.2 1/2] " Max Reitz
2019-10-28 16:18 ` [PATCH for-4.2 2/2] iotests: Add test for 4G+ compressed qcow2 write Max Reitz
2019-10-28 22:36 ` [PATCH for-4.2 0/2] qcow2: Fix QCOW2_COMPRESSED_SECTOR_MASK Alberto Garcia
2019-11-06 11:19 ` Max Reitz [this message]

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=dc66ebe6-8e33-ce74-c408-7a57ee4f8331@redhat.com \
    --to=mreitz@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).