[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] qcow2: Check request size in qcow2_co_pwritev_compressed_
From: |
Max Reitz |
Subject: |
Re: [PATCH v2] qcow2: Check request size in qcow2_co_pwritev_compressed_part() |
Date: |
Tue, 7 Apr 2020 10:51:32 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
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 <address@hidden>
> ---
> 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
signature.asc
Description: OpenPGP digital signature