qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org, Pavel Butsykin <pbutsykin@virtuozzo.com>
Subject: Re: [PATCH v2] qcow2: Check request size in qcow2_co_pwritev_compressed_part()
Date: Tue, 7 Apr 2020 10:51:32 +0200	[thread overview]
Message-ID: <e9415dbd-8c08-89b9-a29f-9c570010a4cc@redhat.com> (raw)
In-Reply-To: <20200406143401.26854-1-berto@igalia.com>


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

On 06.04.20 16:34, Alberto Garcia wrote:
> When issuing a compressed write request the number of bytes must be a
> multiple of the cluster size or reach the end of the last cluster.
> 
> With the current code such requests are allowed and we hit an
> assertion:
> 
>    $ qemu-img create -f qcow2 img.qcow2 1M
>    $ qemu-io -c 'write -c 0 32k' img.qcow2
> 
>    qemu-io: block/qcow2.c:4257: qcow2_co_pwritev_compressed_task:
>    Assertion `bytes == s->cluster_size || (bytes < s->cluster_size &&
>               (offset + bytes == bs->total_sectors << BDRV_SECTOR_BITS))' failed.
>    Aborted
> 
> This patch fixes a regression introduced in 0d483dce38
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>  block/qcow2.c | 5 +++++
>  1 file changed, 5 insertions(+)

Thanks, 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:[~2020-04-07  9:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 14:34 [PATCH v2] qcow2: Check request size in qcow2_co_pwritev_compressed_part() Alberto Garcia
2020-04-06 14:52 ` Andrey Shinkevich
2020-04-06 16:08 ` Alberto Garcia
2020-04-07  6:16   ` Andrey Shinkevich
2020-04-07  7:27 ` Vladimir Sementsov-Ogievskiy
2020-04-07  8:51 ` 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=e9415dbd-8c08-89b9-a29f-9c570010a4cc@redhat.com \
    --to=mreitz@redhat.com \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=pbutsykin@virtuozzo.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).