From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Hanna Reitz <hreitz@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Peng Liang <liangpeng10@huawei.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] block-backend: Retain permissions after migration
Date: Thu, 25 Nov 2021 15:04:22 +0100 [thread overview]
Message-ID: <c211e4ed-e953-03ea-4b17-f1743928c3f3@redhat.com> (raw)
In-Reply-To: <20211125135317.186576-2-hreitz@redhat.com>
On 11/25/21 14:53, Hanna Reitz wrote:
> After migration, the permissions the guest device wants to impose on its
> BlockBackend are stored in blk->perm and blk->shared_perm. In
> blk_root_activate(), we take our permissions, but keep all shared
> permissions open by calling `blk_set_perm(blk->perm, BLK_PERM_ALL)`.
>
> Only afterwards (immediately or later, depending on the runstate) do we
> restrict the shared permissions by calling
> `blk_set_perm(blk->perm, blk->shared_perm)`. Unfortunately, our first
> call with shared_perm=BLK_PERM_ALL has overwritten blk->shared_perm to
> be BLK_PERM_ALL, so this is a no-op and the set of shared permissions is
> not restricted.
>
> Fix this bug by saving the set of shared permissions before invoking
> blk_set_perm() with BLK_PERM_ALL and restoring it afterwards.
>
> Fixes: 5f7772c4d0cf32f4e779fcd5a69ae4dae24aeebf
> ("block-backend: Defer shared_perm tightening migration
> completion")
> Reported-by: Peng Liang <liangpeng10@huawei.com>
> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
> ---
> block/block-backend.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
next prev parent reply other threads:[~2021-11-25 14:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 13:53 [PATCH 0/2] block-backend: Retain permissions after migration Hanna Reitz
2021-11-25 13:53 ` [PATCH 1/2] " Hanna Reitz
2021-11-25 14:04 ` Philippe Mathieu-Daudé [this message]
2021-11-26 8:18 ` Peng Liang via
2021-11-25 13:53 ` [PATCH 2/2] iotests/migration-permissions: New test Hanna Reitz
2021-12-10 16:10 ` [PATCH 0/2] block-backend: Retain permissions after migration Kevin Wolf
2022-01-10 11:51 ` Peng Liang via
2022-01-14 12:45 ` Hanna Reitz
2022-01-14 12:42 ` Hanna 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=c211e4ed-e953-03ea-4b17-f1743928c3f3@redhat.com \
--to=philmd@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=liangpeng10@huawei.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).