From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [PATCH 1/3] quorum: Require WRITE perm with rewrite-corrupted
Date: Fri, 13 Nov 2020 22:17:16 +0100 [thread overview]
Message-ID: <20201113211718.261671-2-mreitz@redhat.com> (raw)
In-Reply-To: <20201113211718.261671-1-mreitz@redhat.com>
Using rewrite-corrupted means quorum may issue writes to its children
just from receiving read requests from its parents. Thus, it must take
the WRITE permission when rewrite-corrupted is used.
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block/quorum.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block/quorum.c b/block/quorum.c
index b70d365ba9..01e49e94a3 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -1195,7 +1195,12 @@ static void quorum_child_perm(BlockDriverState *bs, BdrvChild *c,
uint64_t perm, uint64_t shared,
uint64_t *nperm, uint64_t *nshared)
{
+ BDRVQuorumState *s = bs->opaque;
+
*nperm = perm & DEFAULT_PERM_PASSTHROUGH;
+ if (s->rewrite_corrupted) {
+ *nperm |= BLK_PERM_WRITE;
+ }
/*
* We cannot share RESIZE or WRITE, as this would make the
--
2.28.0
next prev parent reply other threads:[~2020-11-13 21:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 21:17 [PATCH 0/3] quorum: Require WRITE perm with rewrite-corrupted Max Reitz
2020-11-13 21:17 ` Max Reitz [this message]
2020-11-16 12:22 ` [PATCH 1/3] " Alberto Garcia
2020-11-13 21:17 ` [PATCH 2/3] iotests/081: Filter image format after testdir Max Reitz
2020-11-13 21:17 ` [PATCH 3/3] iotests/081: Test rewrite-corrupted without WRITE Max Reitz
2020-11-17 11:38 ` [PATCH 0/3] quorum: Require WRITE perm with rewrite-corrupted 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=20201113211718.261671-2-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@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 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).