Skip to content

mirror: Freeze backing chain for sync=top

Max Reitz qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mirror: Set s->base_overlay only if s->base is setblock/mirror.c+5 -30 replies
2/3mirror: Freeze backing chain for sync=topblock/mirror.c+17 -31 reply
3/3iotests/041: x-blockdev-reopen during mirrortests/qemu-iotests/041 tests/qemu-iotests/041.out+94 -20 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] mirror: Freeze backing chain for sync=top

Hi,

On review of the “Deal with filters” series, Kevin noted that mirror doesn’t freeze its backing chain, even though we keep references to the base (for sync=top). That seems like a recipe for disaster, and as the test added in patch 3 shows, indeed it is.

Patch 1 could also be squashed into “mirror: Deal with filters”.

As for patch 2; maybe it would be sufficient to freeze the backing chain only down to base_overlay and until mirror_dirty_init() is done. Then we bdrv_ref(s->base) so can always be attached to the target when mirror completes. But I think the conservative approach I implemented here is fine until someone complains.

Max Reitz (3):
mirror: Set s->base_overlay only if s->base is set
mirror: Freeze backing chain for sync=top iotests/041: x-blockdev-reopen during mirror

 block/mirror.c             | 28 +++++++++---
 tests/qemu-iotests/041     | 92 ++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/041.out |  4 +-
 3 files changed, 116 insertions(+), 8 deletions(-)
Signature · 1 line
2.26.2