qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: kwolf@redhat.com, ehabkost@redhat.com, qemu-block@nongnu.org,
	armbru@redhat.com, qemu-devel@nongnu.org, hreitz@redhat.com,
	crosa@redhat.com, jsnow@redhat.com
Subject: Re: [PATCH v2] block: drop BLK_PERM_GRAPH_MOD
Date: Fri, 3 Sep 2021 13:47:26 -0500	[thread overview]
Message-ID: <20210903184726.rsz35o4jz6bzddbi@redhat.com> (raw)
In-Reply-To: <20210902093754.2352-1-vsementsov@virtuozzo.com>

On Thu, Sep 02, 2021 at 12:37:54PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> First, this permission never protected a node from being changed, as
> generic child-replacing functions don't check it.
> 
> Second, it's a strange thing: it presents a permission of parent node
> to change its child. But generally, children are replaced by different
> mechanisms, like jobs or qmp commands, not by nodes.
> 
> Graph-mod permission is hard to understand. All other permissions
> describe operations which done by parent node on its child: read,
> write, resize. Graph modification operations are something completely
> different.
> 
> The only place where BLK_PERM_GRAPH_MOD is used as "perm" (not shared
> perm) is mirror_start_job, for s->target. Still modern code should use
> bdrv_freeze_backing_chain() to protect from graph modification, if we
> don't do it somewhere it may be considered as a bug. So, it's a bit
> risky to drop GRAPH_MOD, and analyzing of possible loss of protection
> is hard. But one day we should do it, let's do it now.
> 
> One more bit of information is that locking the corresponding byte in
> file-posix doesn't make sense at all.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> 
> v2: fix grammar
> 
>  qapi/block-core.json          |  7 ++-----
>  include/block/block.h         |  9 +++++----
>  block.c                       |  7 +------
>  block/commit.c                |  1 -
>  block/mirror.c                | 15 +++------------
>  hw/block/block.c              |  3 +--
>  scripts/render_block_graph.py |  1 -
>  tests/qemu-iotests/273.out    |  4 ----
>  8 files changed, 12 insertions(+), 35 deletions(-)
> 
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 06674c25c9..6fa2c4ab82 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -1825,14 +1825,11 @@
>  #
>  # @resize: This permission is required to change the size of a block node.
>  #
> -# @graph-mod: This permission is required to change the node that this
> -#             BdrvChild points to.
> -#

Do we need to mention that graph-mod was removed in 6.2?

>  # Since: 4.0
>  ##
>  { 'enum': 'BlockPermission',
> -  'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
> -            'graph-mod' ] }
> +  'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize' ] }
> +
>  ##
>  # @XDbgBlockGraphEdge:
>  #

Otherwise the patch makes sense to me, but I'd rather that Kevin chime in.

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



  reply	other threads:[~2021-09-03 18:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02  9:37 [PATCH v2] block: drop BLK_PERM_GRAPH_MOD Vladimir Sementsov-Ogievskiy
2021-09-03 18:47 ` Eric Blake [this message]
2021-12-18 15:04   ` Vladimir Sementsov-Ogievskiy
2021-09-22  7:49 ` Vladimir Sementsov-Ogievskiy
2022-01-12 17:10 ` 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=20210903184726.rsz35o4jz6bzddbi@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /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).