All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo
@ 2015-07-03  6:45 Wen Congyang
  2015-07-03  8:41 ` Alberto Garcia
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Wen Congyang @ 2015-07-03  6:45 UTC (permalink / raw)
  To: qemu-devl, Alberto Garcia; +Cc: Stefan Hajnoczi

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 <wency@cn.fujitsu.com>
---
 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;
+    }
+
     ret = parse_read_pattern(qemu_opt_get(opts, QUORUM_OPT_READ_PATTERN));
     if (ret < 0) {
         error_setg(&local_err, "Please set read-pattern as fifo or quorum");
@@ -902,12 +908,6 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
     s->read_pattern = ret;
 
     if (s->read_pattern == QUORUM_READ_PATTERN_QUORUM) {
-        /* and validate it against s->num_children */
-        ret = quorum_valid_threshold(s->threshold, s->num_children, &local_err);
-        if (ret < 0) {
-            goto exit;
-        }
-
         /* is the driver in blkverify mode */
         if (qemu_opt_get_bool(opts, QUORUM_OPT_BLKVERIFY, false) &&
             s->num_children == 2 && s->threshold == 2) {
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo
  2015-07-03  6:45 [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo Wen Congyang
@ 2015-07-03  8:41 ` Alberto Garcia
  2015-07-03  8:50   ` Wen Congyang
  2015-08-19  2:53 ` Wen Congyang
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Alberto Garcia @ 2015-07-03  8:41 UTC (permalink / raw)
  To: Wen Congyang, qemu-devl; +Cc: Liu Yuan, Stefan Hajnoczi

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 <wency@cn.fujitsu.com>
> ---
>  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 <berto@igalia.com>

Berto

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo
  2015-07-03  8:41 ` Alberto Garcia
@ 2015-07-03  8:50   ` Wen Congyang
  0 siblings, 0 replies; 7+ messages in thread
From: Wen Congyang @ 2015-07-03  8:50 UTC (permalink / raw)
  To: Alberto Garcia, qemu-devl; +Cc: Liu Yuan, Stefan Hajnoczi

On 07/03/2015 04:41 PM, Alberto Garcia wrote:
> 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 <wency@cn.fujitsu.com>
>> ---
>>  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?

Yes.

Thanks
Wen Congyang

> 
> Reviewed-by: Alberto Garcia <berto@igalia.com>
> 
> Berto
> .
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo
  2015-07-03  6:45 [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo Wen Congyang
  2015-07-03  8:41 ` Alberto Garcia
@ 2015-08-19  2:53 ` Wen Congyang
  2015-08-20 17:27   ` Kevin Wolf
  2015-08-24 18:26 ` Max Reitz
  2015-08-26 15:29 ` Max Reitz
  3 siblings, 1 reply; 7+ messages in thread
From: Wen Congyang @ 2015-08-19  2:53 UTC (permalink / raw)
  To: qemu-devl, Alberto Garcia; +Cc: Stefan Hajnoczi

Ping...

On 07/03/2015 02:45 PM, 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 <wency@cn.fujitsu.com>
> ---
>  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;
> +    }
> +
>      ret = parse_read_pattern(qemu_opt_get(opts, QUORUM_OPT_READ_PATTERN));
>      if (ret < 0) {
>          error_setg(&local_err, "Please set read-pattern as fifo or quorum");
> @@ -902,12 +908,6 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
>      s->read_pattern = ret;
>  
>      if (s->read_pattern == QUORUM_READ_PATTERN_QUORUM) {
> -        /* and validate it against s->num_children */
> -        ret = quorum_valid_threshold(s->threshold, s->num_children, &local_err);
> -        if (ret < 0) {
> -            goto exit;
> -        }
> -
>          /* is the driver in blkverify mode */
>          if (qemu_opt_get_bool(opts, QUORUM_OPT_BLKVERIFY, false) &&
>              s->num_children == 2 && s->threshold == 2) {
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo
  2015-08-19  2:53 ` Wen Congyang
@ 2015-08-20 17:27   ` Kevin Wolf
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Wolf @ 2015-08-20 17:27 UTC (permalink / raw)
  To: Wen Congyang; +Cc: qemu-block, Alberto Garcia, qemu-devl, Stefan Hajnoczi

Am 19.08.2015 um 04:53 hat Wen Congyang geschrieben:
> Ping...

It might have helped to...

a) CC the qemu-block mailing list
b) CC the subsystem maintainer that should apply the patch (according to
   scripts/get_maintainer.pl that's me with Berto's Acked-by)
c) include the "PATCH" keyword in the subject line.

I'm copying qemu-block now and will consider the patch once I'm back
from KVM Forum.

Kevin


> On 07/03/2015 02:45 PM, 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 <wency@cn.fujitsu.com>
> > ---
> >  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;
> > +    }
> > +
> >      ret = parse_read_pattern(qemu_opt_get(opts, QUORUM_OPT_READ_PATTERN));
> >      if (ret < 0) {
> >          error_setg(&local_err, "Please set read-pattern as fifo or quorum");
> > @@ -902,12 +908,6 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
> >      s->read_pattern = ret;
> >  
> >      if (s->read_pattern == QUORUM_READ_PATTERN_QUORUM) {
> > -        /* and validate it against s->num_children */
> > -        ret = quorum_valid_threshold(s->threshold, s->num_children, &local_err);
> > -        if (ret < 0) {
> > -            goto exit;
> > -        }
> > -
> >          /* is the driver in blkverify mode */
> >          if (qemu_opt_get_bool(opts, QUORUM_OPT_BLKVERIFY, false) &&
> >              s->num_children == 2 && s->threshold == 2) {
> > 
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo
  2015-07-03  6:45 [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo Wen Congyang
  2015-07-03  8:41 ` Alberto Garcia
  2015-08-19  2:53 ` Wen Congyang
@ 2015-08-24 18:26 ` Max Reitz
  2015-08-26 15:29 ` Max Reitz
  3 siblings, 0 replies; 7+ messages in thread
From: Max Reitz @ 2015-08-24 18:26 UTC (permalink / raw)
  To: Wen Congyang, qemu-devl, Alberto Garcia; +Cc: Stefan Hajnoczi

On 03.07.2015 08:45, 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 <wency@cn.fujitsu.com>
> ---
>  block/quorum.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo
  2015-07-03  6:45 [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo Wen Congyang
                   ` (2 preceding siblings ...)
  2015-08-24 18:26 ` Max Reitz
@ 2015-08-26 15:29 ` Max Reitz
  3 siblings, 0 replies; 7+ messages in thread
From: Max Reitz @ 2015-08-26 15:29 UTC (permalink / raw)
  To: Wen Congyang, qemu-devl, Alberto Garcia; +Cc: Stefan Hajnoczi

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

On 03.07.2015 08:45, 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 <wency@cn.fujitsu.com>
> ---
>  block/quorum.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Thanks, applied to my block tree:

https://github.com/XanClic/qemu/commits/block


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-08-26 15:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-03  6:45 [Qemu-devel] quorum: validate vote threshold against num_children even if read-pattern is fifo Wen Congyang
2015-07-03  8:41 ` Alberto Garcia
2015-07-03  8:50   ` Wen Congyang
2015-08-19  2:53 ` Wen Congyang
2015-08-20 17:27   ` Kevin Wolf
2015-08-24 18:26 ` Max Reitz
2015-08-26 15:29 ` Max Reitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.