All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Krempa <pkrempa@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [PATCH v2 5/7] block: Fix cross-AioContext blockdev-snapshot
Date: Tue, 10 Mar 2020 14:27:13 +0100	[thread overview]
Message-ID: <20200310132713.GC1320660@angien.pipo.sk> (raw)
In-Reply-To: <20200310113831.27293-6-kwolf@redhat.com>

On Tue, Mar 10, 2020 at 12:38:29 +0100, Kevin Wolf wrote:
> external_snapshot_prepare() tries to move the overlay to the AioContext
> of the backing file (the snapshotted node). However, it's possible that
> this doesn't work, but the backing file can instead be moved to the
> overlay's AioContext (e.g. opening the backing chain for a mirror
> target).
> 
> bdrv_append() already indirectly uses bdrv_attach_node(), which takes
> care to move nodes to make sure they use the same AioContext and which
> tries both directions.
> 
> So the problem has a simple fix: Just delete the unnecessary extra
> bdrv_try_set_aio_context() call in external_snapshot_prepare() and
> instead assert in bdrv_append() that both nodes were indeed moved to the
> same AioContext.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block.c    |  1 +
>  blockdev.c | 16 ----------------
>  2 files changed, 1 insertion(+), 16 deletions(-)

Tested-by: Peter Krempa <pkrempa@redhat.com>

Unfortunately I don't feel confident enough in the intricacies of the
aio contexts. Nevertheless Fixing bugs by deleting code is awesome!



  reply	other threads:[~2020-03-10 13:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 11:38 [PATCH v2 0/7] block: Relax restrictions for blockdev-snapshot Kevin Wolf
2020-03-10 11:38 ` [PATCH v2 1/7] block: Make bdrv_get_cumulative_perm() public Kevin Wolf
2020-03-10 13:10   ` Peter Krempa
2020-03-10 11:38 ` [PATCH v2 2/7] block: Relax restrictions for blockdev-snapshot Kevin Wolf
2020-03-10 13:15   ` Peter Krempa
2020-03-10 13:27     ` Kevin Wolf
2020-03-10 11:38 ` [PATCH v2 3/7] iotests: Fix run_job() with use_log=False Kevin Wolf
2020-03-10 13:16   ` Peter Krempa
2020-03-10 11:38 ` [PATCH v2 4/7] iotests: Test mirror with temporarily disabled target backing file Kevin Wolf
2020-03-10 13:25   ` Peter Krempa
2020-03-10 11:38 ` [PATCH v2 5/7] block: Fix cross-AioContext blockdev-snapshot Kevin Wolf
2020-03-10 13:27   ` Peter Krempa [this message]
2020-03-10 11:38 ` [PATCH v2 6/7] iotests: Add iothread cases to 155 Kevin Wolf
2020-03-10 13:28   ` Peter Krempa
2020-03-10 11:38 ` [PATCH v2 7/7] qapi: Add '@allow-write-only-overlay' feature for 'blockdev-snapshot' Kevin Wolf
2020-03-10 17:43 ` [PATCH v2 0/7] block: Relax restrictions for blockdev-snapshot Kevin Wolf

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=20200310132713.GC1320660@angien.pipo.sk \
    --to=pkrempa@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.