[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] quorum: validate vote threshold against num_children ev
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo |
Date: |
Fri, 03 Jul 2015 10:41:25 +0200 |
User-agent: |
Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) |
On Fri 03 Jul 2015 08:45:06 AM CEST, Wen Congyang wrote:
> We need to use threshold to check if too many write operation fails.
> If threshold is larger than num children, we always get write error
> event even if all write operations success.
>
> Signed-off-by: Wen Congyang <address@hidden>
> ---
> block/quorum.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/block/quorum.c b/block/quorum.c
> index a7df17c..b0eead0 100644
> --- a/block/quorum.c
> +++ b/block/quorum.c
> @@ -894,6 +894,12 @@ static int quorum_open(BlockDriverState *bs, QDict
> *options, int flags,
> }
>
> s->threshold = qemu_opt_get_number(opts, QUORUM_OPT_VOTE_THRESHOLD, 0);
> + /* and validate it against s->num_children */
> + ret = quorum_valid_threshold(s->threshold, s->num_children, &local_err);
> + if (ret < 0) {
> + goto exit;
> + }
> +
I wonder why this check was moved inside the (s->read_pattern ==
QUORUM_READ_PATTERN_QUORUM) block when the fifo mode was introduced
(adding Liu Yuan to Cc).
I assume that you are not going to allow removing children under the
vote_threshold limit as we discussed, right?
Reviewed-by: Alberto Garcia <address@hidden>
Berto