From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: Eric Blake <eblake@redhat.com>, John Snow <jsnow@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org, armbru@redhat.com,
mreitz@redhat.com, famz@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH v2 2/3] block/fleecing-filter: new filter driver for fleecing
Date: Tue, 3 Jul 2018 20:02:57 +0200 [thread overview]
Message-ID: <20180703180257.GF28229@localhost.localdomain> (raw)
In-Reply-To: <e77b0d41-ac6c-9480-3260-b3a6ed31327e@virtuozzo.com>
Am 03.07.2018 um 18:11 hat Vladimir Sementsov-Ogievskiy geschrieben:
> 03.07.2018 14:15, Kevin Wolf wrote:
> > We'll have to figure out where to fix this problem (or what it really
> > is, once you look more than just at fleecing), but I think requiring the
> > user to add a filter driver to work around missing serialisation in
> > other code, and corrupting their image if they forget to, is not a
> > reasonable solution.
> >
> > I see at least two things wrong in this context:
> >
> > * The permissions don't seem to match reality. The NBD server
> > unconditionally shares PERM_WRITE, which is wrong in this case. The
> > client wants to see a point-in-time snapshot that never changes. This
> > should become an option so that it can be properly reflected in the
> > permissions used.
> >
> > * Once we have proper permissions, the fleecing setup breaks down
> > because the guest needs PERM_WRITE on the backing file, but the
> > fleecing overlay allows that only if the NBD client allows it (which
> > it doesn't for fleecing).
> >
> > Now we can implement an exception right into backup that installs a
> > backup filter driver between source and target if the source is the
> > backing file of the target. The filter driver would be similar to the
> > commit filter driver in that it simply promises !PERM_WRITE to its
> > parents, but allows PERM_WRITE on the source because it has installed
> > the before_write_notifier that guarantees this condition.
> >
> > All writes to the target that are made by the backup job in this setup
> > (including before_write_notifier writes) need to be marked as
> > serialising so that any concurrent reads are completed first.
> >
> > And if we decide to add a target filter to backup, we should probably at
> > the same time use a filter driver for intercepting source writes instead
> > of using before_write_notifier.
>
> Hmm, is it possible to do all the staff in one super filter driver, which we
> insert into the tree like this:
>
> top blk fleecing qcow2
> + +
> | |backing
> v <-----+
> super filter
> +
> |file
> v
> active image
>
>
> And super filter do the following:
>
> 1. copy-on-write, before forwarding write to file, it do serializing write
> to fleecing qcow2
This is where it breaks down. The filter driver in your graph doesn't
know fleecing.qcow2, so it can't write to it. Attaching fleecing.qcow2
as an additional child to the super filter doesn't work either because
you would create a loop then.
I think we need two separate nodes (and probably it's better to have
them managed by a block job so that both together can be checked to
result in a consistent setup).
> 2. fake .bdrv_child_perm for fleecing qcow2, like in block commit
>
> and no block job is needed.
Kevin
next prev parent reply other threads:[~2018-07-03 18:03 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-29 15:15 [Qemu-devel] [PATCH v2 0/3] image fleecing Vladimir Sementsov-Ogievskiy
2018-06-29 15:15 ` [Qemu-devel] [PATCH v2 1/3] blockdev-backup: enable non-root nodes for backup source Vladimir Sementsov-Ogievskiy
2018-06-29 17:13 ` Eric Blake
2018-06-29 17:31 ` John Snow
2018-06-29 15:15 ` [Qemu-devel] [PATCH v2 2/3] block/fleecing-filter: new filter driver for fleecing Vladimir Sementsov-Ogievskiy
2018-06-29 17:24 ` Eric Blake
2018-07-02 6:35 ` Fam Zheng
2018-07-02 11:27 ` Vladimir Sementsov-Ogievskiy
2018-07-02 11:47 ` Vladimir Sementsov-Ogievskiy
2018-06-29 17:30 ` John Snow
2018-06-29 17:40 ` Eric Blake
2018-07-02 12:09 ` Vladimir Sementsov-Ogievskiy
2018-07-03 11:15 ` Kevin Wolf
2018-07-03 11:52 ` Vladimir Sementsov-Ogievskiy
2018-07-03 16:11 ` Vladimir Sementsov-Ogievskiy
2018-07-03 18:02 ` Kevin Wolf [this message]
2018-07-04 14:07 ` Max Reitz
2018-07-02 11:57 ` Vladimir Sementsov-Ogievskiy
2018-07-03 11:22 ` Kevin Wolf
2018-06-29 15:15 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: Image fleecing test case 222 Vladimir Sementsov-Ogievskiy
2018-06-29 15:31 ` Vladimir Sementsov-Ogievskiy
2018-06-29 17:58 ` Eric Blake
2018-06-29 21:04 ` John Snow
2018-07-02 6:45 ` Fam Zheng
2018-07-02 12:58 ` Vladimir Sementsov-Ogievskiy
2018-06-29 16:38 ` [Qemu-devel] [PATCH v2 0/3] image fleecing John Snow
2018-06-29 17:36 ` Vladimir Sementsov-Ogievskiy
2018-06-29 17:52 ` Vladimir Sementsov-Ogievskiy
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=20180703180257.GF28229@localhost.localdomain \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=jsnow@redhat.com \
--cc=mreitz@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).