qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] mirror: Fail gracefully for source == target
Date: Tue, 14 Aug 2018 07:57:39 -0500	[thread overview]
Message-ID: <bd0e7f07-d920-17d8-d0a0-b125c46e56fe@redhat.com> (raw)
In-Reply-To: <20180814095847.23778-1-kwolf@redhat.com>

On 08/14/2018 04:58 AM, Kevin Wolf wrote:
> blockdev-mirror with the same node for source and target segfaults
> today: A node is in its own backing chain, so mirror_start_job() decides
> that this is an active commit. When adding the intermediate nodes with
> block_job_add_bdrv(), it starts the iteration through the subchain with
> the backing file of source, though, so it never reaches target and
> instead runs into NULL at the base.
> 
> While we could fix that by starting with source itself, there is no
> point in allowing mirroring a node into itself and I wouldn't be
> surprised if this caused more problems later.
> 
> So just check for this scenario and error out.
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>   block/mirror.c             | 5 +++++
>   tests/qemu-iotests/041     | 6 ++++++
>   tests/qemu-iotests/041.out | 4 ++--
>   3 files changed, 13 insertions(+), 2 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

      reply	other threads:[~2018-08-14 12:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14  9:58 [Qemu-devel] [PATCH] mirror: Fail gracefully for source == target Kevin Wolf
2018-08-14 12:57 ` Eric Blake [this message]

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=bd0e7f07-d920-17d8-d0a0-b125c46e56fe@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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).