qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] block: align CoR requests to subclusters
@ 2023-06-26 16:08 Andrey Drobyshev via
  2023-06-26 16:08 ` [PATCH 1/3] block: add subcluster_size field to BlockDriverInfo Andrey Drobyshev via
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Andrey Drobyshev via @ 2023-06-26 16:08 UTC (permalink / raw)
  To: qemu-block, qemu-stable
  Cc: qemu-devel, kwolf, hreitz, vsementsov, eblake, andrey.drobyshev,
	den

This series makes IO requests performed with copy-on-read to be aligned
to subclusters rather than clusters.  It also affects mirror job requests
alignment.

The initial reason for that change is the following crash discovered:

qemu-img create -f qcow2 base.qcow2 64K
qemu-img create -f qcow2 -o extended_l2=on,backing_file=base.qcow2,backing_fmt=qcow2 img.qcow2 64K
qemu-io -c "write -P 0xaa 0 2K" img.qcow2
qemu-io -C -c "read -P 0x00 2K 62K" img.qcow2

qemu-io: ../block/io.c:1236: bdrv_co_do_copy_on_readv: Assertion `skip_bytes < pnum' failed.

This change in alignment fixes the crash and adds test case covering it.

Andrey Drobyshev (3):
  block: add subcluster_size field to BlockDriverInfo
  block/io: align requests to subcluster_size
  tests/qemu-iotests/197: add testcase for CoR with subclusters

 block.c                      |  6 +++++
 block/io.c                   | 50 ++++++++++++++++++------------------
 block/mirror.c               |  8 +++---
 block/qcow2.c                |  1 +
 include/block/block-common.h |  4 +++
 include/block/block-io.h     |  2 +-
 tests/qemu-iotests/197       | 29 +++++++++++++++++++++
 tests/qemu-iotests/197.out   | 24 +++++++++++++++++
 8 files changed, 94 insertions(+), 30 deletions(-)

-- 
2.39.3



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-07-11 17:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-26 16:08 [PATCH 0/3] block: align CoR requests to subclusters Andrey Drobyshev via
2023-06-26 16:08 ` [PATCH 1/3] block: add subcluster_size field to BlockDriverInfo Andrey Drobyshev via
2023-07-10 19:44   ` Eric Blake
2023-07-11 16:57   ` Denis V. Lunev
2023-06-26 16:08 ` [PATCH 2/3] block/io: align requests to subcluster_size Andrey Drobyshev via
2023-07-10 19:47   ` Eric Blake
2023-07-11 17:46     ` Andrey Drobyshev
2023-07-11 17:05   ` Denis V. Lunev
2023-06-26 16:08 ` [PATCH 3/3] tests/qemu-iotests/197: add testcase for CoR with subclusters Andrey Drobyshev via
2023-07-10 19:50   ` Eric Blake
2023-07-11 17:05   ` Denis V. Lunev
2023-07-07 11:33 ` [PATCH 0/3] block: align CoR requests to subclusters Andrey Drobyshev

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).