[PATCH 0/3] block/mirror: fix assertion failure upon duplicate complete for job using 'replaces'

Fiona Ebner posted 3 patches 3 weeks, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260311145717.668492-1-f.ebner@proxmox.com
Maintainers: John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
There is a newer version of this series
block/mirror.c             |  28 +++----
tests/qemu-iotests/041     | 153 ++++++++++++++++++++++++++++++++++++-
tests/qemu-iotests/041.out |   4 +-
3 files changed, 169 insertions(+), 16 deletions(-)
[PATCH 0/3] block/mirror: fix assertion failure upon duplicate complete for job using 'replaces'
Posted by Fiona Ebner 3 weeks, 6 days ago
If s->replace_blocker was already set by an earlier invocation of
mirror_complete(), then there will be an assertion failure when
error_setg() is called for it a second time. The bdrv_ref() operation
should only be done a single time too.

I thought about using an early return with an error, but that might
break existing users that (accidentally) issue duplicate
'job-complete' without using 'replaces'.

A paused job does not accept the 'complete' verb, so using an
externally throttled node was the best I could come up with for the
test.

Fiona Ebner (3):
  block/mirror: fix assertion failure upon duplicate complete for job
    using 'replaces'
  iotests/041: add test for mirror with throttled NBD export as target
  iotests/041: add test for duplicate job-complete with throttled target

 block/mirror.c             |  28 +++----
 tests/qemu-iotests/041     | 153 ++++++++++++++++++++++++++++++++++++-
 tests/qemu-iotests/041.out |   4 +-
 3 files changed, 169 insertions(+), 16 deletions(-)

-- 
2.47.3
Re: [PATCH 0/3] block/mirror: fix assertion failure upon duplicate complete for job using 'replaces'
Posted by Hanna Czenczek 3 weeks ago
On 11.03.26 15:54, Fiona Ebner wrote:
> If s->replace_blocker was already set by an earlier invocation of
> mirror_complete(), then there will be an assertion failure when
> error_setg() is called for it a second time. The bdrv_ref() operation
> should only be done a single time too.
>
> I thought about using an early return with an error, but that might
> break existing users that (accidentally) issue duplicate
> 'job-complete' without using 'replaces'.
>
> A paused job does not accept the 'complete' verb, so using an
> externally throttled node was the best I could come up with for the
> test.
>
> Fiona Ebner (3):
>    block/mirror: fix assertion failure upon duplicate complete for job
>      using 'replaces'

Thanks, I’ve applied this patch 1 to my block branch (for rc0):

https://gitlab.com/hreitz/qemu/-/commits/block

Better to have the code in earlier, and add the test later.

Hanna