All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fiona Ebner <f.ebner@proxmox.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	qemu-stable@nongnu.org, hreitz@redhat.com, kwolf@redhat.com,
	fam@euphon.net, t.lamprecht@proxmox.com, w.bumiller@proxmox.com
Subject: Re: [PATCH v3 1/4] block/io: accept NULL qiov in bdrv_pad_request
Date: Mon, 25 Mar 2024 15:56:38 -0400	[thread overview]
Message-ID: <20240325195638.GA1944176@fedora> (raw)
In-Reply-To: <20240322095009.346989-2-f.ebner@proxmox.com>

[-- Attachment #1: Type: text/plain, Size: 1960 bytes --]

On Fri, Mar 22, 2024 at 10:50:06AM +0100, Fiona Ebner wrote:
> From: Stefan Reiter <s.reiter@proxmox.com>
> 
> Some operations, e.g. block-stream, perform reads while discarding the
> results (only copy-on-read matters). In this case, they will pass NULL
> as the target QEMUIOVector, which will however trip bdrv_pad_request,
> since it wants to extend its passed vector. In particular, this is the
> case for the blk_co_preadv() call in stream_populate().
> 
> If there is no qiov, no operation can be done with it, but the bytes
> and offset still need to be updated, so the subsequent aligned read
> will actually be aligned and not run into an assertion failure.
> 
> In particular, this can happen when the request alignment of the top
> node is larger than the allocated part of the bottom node, in which
> case padding becomes necessary. For example:
> 
> > ./qemu-img create /tmp/backing.qcow2 -f qcow2 64M -o cluster_size=32768
> > ./qemu-io -c "write -P42 0x0 0x1" /tmp/backing.qcow2
> > ./qemu-img create /tmp/top.qcow2 -f qcow2 64M -b /tmp/backing.qcow2 -F qcow2
> > ./qemu-system-x86_64 --qmp stdio \
> > --blockdev qcow2,node-name=node0,file.driver=file,file.filename=/tmp/top.qcow2 \
> > <<EOF
> > {"execute": "qmp_capabilities"}
> > {"execute": "blockdev-add", "arguments": { "driver": "compress", "file": "node0", "node-name": "node1" } }
> > {"execute": "block-stream", "arguments": { "job-id": "stream0", "device": "node1" } }
> > EOF
> 
> Originally-by: Stefan Reiter <s.reiter@proxmox.com>
> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
> [FE: do update bytes and offset in any case
>      add reproducer to commit message]
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> 
> No changes in v3.
> No changes in v2.
> 
>  block/io.c | 31 +++++++++++++++++++------------
>  1 file changed, 19 insertions(+), 12 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

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

  reply	other threads:[~2024-03-25 19:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22  9:50 [PATCH v3 0/4] fix two edge cases related to stream block jobs Fiona Ebner
2024-03-22  9:50 ` [PATCH v3 1/4] block/io: accept NULL qiov in bdrv_pad_request Fiona Ebner
2024-03-25 19:56   ` Stefan Hajnoczi [this message]
2024-03-22  9:50 ` [PATCH v3 2/4] block-backend: fix edge case in bdrv_next() where BDS associated to BB changes Fiona Ebner
2024-03-25 20:06   ` Stefan Hajnoczi
2024-03-26 12:44   ` Kevin Wolf
2024-06-03 14:17     ` Fiona Ebner
2024-06-03 16:21       ` Kevin Wolf
2024-06-04  7:58         ` Fiona Ebner
2024-06-04 15:28           ` Kevin Wolf
2024-06-05 14:14             ` Fiona Ebner
2024-03-22  9:50 ` [PATCH v3 3/4] block-backend: fix edge case in bdrv_next_cleanup() " Fiona Ebner
2024-03-25 20:07   ` Stefan Hajnoczi
2024-03-22  9:50 ` [PATCH v3 4/4] iotests: add test for stream job with an unaligned prefetch read Fiona Ebner
2024-03-25 20:09   ` Stefan Hajnoczi
2024-03-25 20:11 ` [PATCH v3 0/4] fix two edge cases related to stream block jobs Stefan Hajnoczi
2024-03-26 12:53   ` Kevin Wolf

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=20240325195638.GA1944176@fedora \
    --to=stefanha@redhat.com \
    --cc=f.ebner@proxmox.com \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=t.lamprecht@proxmox.com \
    --cc=w.bumiller@proxmox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.