Skip to content

qcow2: Fix alloc_cluster_abort() for pre-existing clusters

Max Reitz qemu-devel 1 version Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3qcow2: Fix alloc_cluster_abort() for pre-existing clustersblock/qcow2-cluster.c+1 -10 replies
2/3iotests/026: Test EIO on preallocated zero clustertests/qemu-iotests/026 tests/qemu-iotests/026.out tests/qemu-iotests/026.out.nocache+41 -00 replies
3/3iotests/026: Test EIO on allocation in a data-filetests/qemu-iotests/026 tests/qemu-iotests/026.out tests/qemu-iotests/026.out.nocache+44 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] qcow2: Fix alloc_cluster_abort() for pre-existing clusters

Hi,

With c3b6658c1a5a3fb2, Kevin has fixed a case in alloc_cluster_abort() where we used to free a cluster that wasn’t even allocated by handle_alloc(), thus leading to an error and/or corruption. Besides external data files, there is another case where alloc_cluster_abort() must not free the “new” cluster: Namely when the cluster isn’t new because we’re reusing an existing pre-allocated zero cluster.

I think Berto’s subcluster series fixes this, too, but it’s still an RFC, so I suppose we have to fix the bug independently of it.

Patch 2 adds a regression test; patch 3 adds a regression test for Kevin’s patch c3b6658c1a5a3fb2 (which didn’t come with one).

Max Reitz (3):
qcow2: Fix alloc_cluster_abort() for pre-existing clusters iotests/026: Test EIO on preallocated zero cluster iotests/026: Test EIO on allocation in a data-file

 block/qcow2-cluster.c              |  2 +-
 tests/qemu-iotests/026             | 53 ++++++++++++++++++++++++++++++
 tests/qemu-iotests/026.out         | 16 +++++++++
 tests/qemu-iotests/026.out.nocache | 16 +++++++++
 4 files changed, 86 insertions(+), 1 deletion(-)
Signature · 1 line
2.24.1