qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [PATCH 0/3] mirror: Freeze backing chain for sync=top
Date: Wed,  2 Sep 2020 18:48:38 +0200	[thread overview]
Message-ID: <20200902164841.214948-1-mreitz@redhat.com> (raw)

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

-- 
2.26.2



             reply	other threads:[~2020-09-02 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 16:48 Max Reitz [this message]
2020-09-02 16:48 ` [PATCH 1/3] mirror: Set s->base_overlay only if s->base is set Max Reitz
2020-09-02 16:48 ` [PATCH 2/3] mirror: Freeze backing chain for sync=top Max Reitz
2020-09-02 17:00   ` Max Reitz
2020-09-02 16:48 ` [PATCH 3/3] iotests/041: x-blockdev-reopen during mirror Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200902164841.214948-1-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).