From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Tao Xu <tao3.xu@intel.com>,
qemu-block@nongnu.org
Subject: Re: [PATCH v4 2/2] quorum: Implement bdrv_co_pwrite_zeroes()
Date: Fri, 13 Nov 2020 20:44:05 +0100 [thread overview]
Message-ID: <0bae0aab-999e-1a68-852e-decc7149bbf5@redhat.com> (raw)
In-Reply-To: <2f09c842781fe336b4c2e40036bba577b7430190.1605286097.git.berto@igalia.com>
On 13.11.20 17:52, Alberto Garcia wrote:
> This simply calls bdrv_co_pwrite_zeroes() in all children.
>
> bs->supported_zero_flags is also set to the flags that are supported
> by all children.
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
> block/quorum.c | 36 ++++++++++++++++++++++++++++++++++--
> tests/qemu-iotests/312 | 11 +++++++++++
> tests/qemu-iotests/312.out | 8 ++++++++
> 3 files changed, 53 insertions(+), 2 deletions(-)
Reviewed-by: Max Reitz <mreitz@redhat.com>
> @@ -897,6 +910,21 @@ static QemuOptsList quorum_runtime_opts = {
> },
> };
>
> +static void quorum_refresh_flags(BlockDriverState *bs)
> +{
> + BDRVQuorumState *s = bs->opaque;
> + int i;
> +
> + bs->supported_zero_flags =
> + BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK;
> +
> + for (i = 0; i < s->num_children; i++) {
> + bs->supported_zero_flags &= s->children[i]->bs->supported_zero_flags;
> + }
> +
> + bs->supported_zero_flags |= BDRV_REQ_WRITE_UNCHANGED;
This made me wonder whether it’s true when rewrite_corrupted is set. I
think it is, because that only does something when reading from the
children (i.e. not for write requests from parents, where this flag
might be set).
Looking into quorum_child_perm(), quorum doesn’t take the WRITE
permission on its children even if rewrite_corrupted is true. Hm...
Something to look into.
Max
> +}
> +
> static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
> Error **errp)
> {
next prev parent reply other threads:[~2020-11-13 19:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 16:52 [PATCH v4 0/2] quorum: Implement bdrv_co_block_status() Alberto Garcia
2020-11-13 16:52 ` [PATCH v4 1/2] " Alberto Garcia
2020-11-13 16:52 ` [PATCH v4 2/2] quorum: Implement bdrv_co_pwrite_zeroes() Alberto Garcia
2020-11-13 19:44 ` Max Reitz [this message]
2020-11-13 19:44 ` [PATCH v4 0/2] quorum: Implement bdrv_co_block_status() Max 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=0bae0aab-999e-1a68-852e-decc7149bbf5@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=tao3.xu@intel.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).