[PATCH 0/4] qcow2: Fix corruption on discard during write with COW

Kevin Wolf posted 4 patches 3 weeks, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260427170520.101242-1-kwolf@redhat.com
Maintainers: John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
block/commit.c             |  10 +++-
block/qcow2-cluster.c      |  52 ++++++++++++++++-
qemu-io-cmds.c             | 113 +++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/046     |  46 +++++++++++++++
tests/qemu-iotests/046.out |  36 ++++++++++++
5 files changed, 252 insertions(+), 5 deletions(-)
[PATCH 0/4] qcow2: Fix corruption on discard during write with COW
Posted by Kevin Wolf 3 weeks, 6 days ago
This is an alternative fix for the corruption problem reported by Denis:
https://patchew.org/QEMU/20260421155628.3600671-1-den@openvz.org/

I think it really is a qcow2 level bug and should be fixed on the qcow2
level. The test is also more targeted than just doing random I/O for a
while, and therefore runs faster and documents the problem better.

Kevin Wolf (4):
  commit: Drain nodes across all of bdrv_commit()
  qemu-io: Add 'aio_discard' command
  qcow2: Fix corruption on discard during write with COW
  iotests/046: Test that discard/write_zeroes wait for dependencies

 block/commit.c             |  10 +++-
 block/qcow2-cluster.c      |  52 ++++++++++++++++-
 qemu-io-cmds.c             | 113 +++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/046     |  46 +++++++++++++++
 tests/qemu-iotests/046.out |  36 ++++++++++++
 5 files changed, 252 insertions(+), 5 deletions(-)

-- 
2.53.0
Re: [PATCH 0/4] qcow2: Fix corruption on discard during write with COW
Posted by Denis V. Lunev 3 weeks, 6 days ago
On 4/27/26 19:05, Kevin Wolf wrote:
> This is an alternative fix for the corruption problem reported by Denis:
> https://patchew.org/QEMU/20260421155628.3600671-1-den@openvz.org/
>
> I think it really is a qcow2 level bug and should be fixed on the qcow2
> level. The test is also more targeted than just doing random I/O for a
> while, and therefore runs faster and documents the problem better.
>
> Kevin Wolf (4):
>   commit: Drain nodes across all of bdrv_commit()
>   qemu-io: Add 'aio_discard' command
>   qcow2: Fix corruption on discard during write with COW
>   iotests/046: Test that discard/write_zeroes wait for dependencies
>
>  block/commit.c             |  10 +++-
>  block/qcow2-cluster.c      |  52 ++++++++++++++++-
>  qemu-io-cmds.c             | 113 +++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/046     |  46 +++++++++++++++
>  tests/qemu-iotests/046.out |  36 ++++++++++++
>  5 files changed, 252 insertions(+), 5 deletions(-)
>
with a 2 small nickpicks fixed

Reviewed-by: Denis V. Lunev <den@openvz.org>
Tested-by: Denis V. Lunev <den@openvz.org>