xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: remove wrong statement about bug in xenstore
@ 2016-10-24 11:27 Juergen Gross
  2016-10-24 11:41 ` Wei Liu
  2016-10-26 12:02 ` Wei Liu
  0 siblings, 2 replies; 7+ messages in thread
From: Juergen Gross @ 2016-10-24 11:27 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, sstabellini, wei.liu2, George.Dunlap,
	andrew.cooper3, ian.jackson, tim, jbeulich

docs/misc/xenstore.txt states that xenstored will use "0" as a valid
transaction id after 2^32 transactions. This is not true. Remove that
statement.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 docs/misc/xenstore.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
index c9f4a05..ae1b6a8 100644
--- a/docs/misc/xenstore.txt
+++ b/docs/misc/xenstore.txt
@@ -229,8 +229,6 @@ TRANSACTION_START	|			<transid>|
 	tx_id request header field.  When transaction is started whole
 	db is copied; reads and writes happen on the copy.
 	It is not legal to send non-0 tx_id in TRANSACTION_START.
-	Currently xenstored has the bug that after 2^32 transactions
-	it will allocate the transid 0 for an actual transaction.
 
 TRANSACTION_END		T|
 TRANSACTION_END		F|
-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] docs: remove wrong statement about bug in xenstore
  2016-10-24 11:27 [PATCH] docs: remove wrong statement about bug in xenstore Juergen Gross
@ 2016-10-24 11:41 ` Wei Liu
  2016-10-24 11:49   ` Juergen Gross
  2016-10-26 12:02 ` Wei Liu
  1 sibling, 1 reply; 7+ messages in thread
From: Wei Liu @ 2016-10-24 11:41 UTC (permalink / raw)
  To: Juergen Gross
  Cc: tim, sstabellini, wei.liu2, George.Dunlap, andrew.cooper3,
	ian.jackson, xen-devel, jbeulich

On Mon, Oct 24, 2016 at 01:27:17PM +0200, Juergen Gross wrote:
> docs/misc/xenstore.txt states that xenstored will use "0" as a valid
> transaction id after 2^32 transactions. This is not true. Remove that
> statement.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Can you point me to the relevant code snippet? Better still I would like
to see why it is the case in commit message.

> ---
>  docs/misc/xenstore.txt | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
> index c9f4a05..ae1b6a8 100644
> --- a/docs/misc/xenstore.txt
> +++ b/docs/misc/xenstore.txt
> @@ -229,8 +229,6 @@ TRANSACTION_START	|			<transid>|
>  	tx_id request header field.  When transaction is started whole
>  	db is copied; reads and writes happen on the copy.
>  	It is not legal to send non-0 tx_id in TRANSACTION_START.
> -	Currently xenstored has the bug that after 2^32 transactions
> -	it will allocate the transid 0 for an actual transaction.
>  
>  TRANSACTION_END		T|
>  TRANSACTION_END		F|
> -- 
> 2.6.6
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] docs: remove wrong statement about bug in xenstore
  2016-10-24 11:41 ` Wei Liu
@ 2016-10-24 11:49   ` Juergen Gross
  2016-10-24 12:06     ` Andrew Cooper
  0 siblings, 1 reply; 7+ messages in thread
From: Juergen Gross @ 2016-10-24 11:49 UTC (permalink / raw)
  To: Wei Liu
  Cc: tim, sstabellini, George.Dunlap, andrew.cooper3, ian.jackson,
	xen-devel, jbeulich

On 24/10/16 13:41, Wei Liu wrote:
> On Mon, Oct 24, 2016 at 01:27:17PM +0200, Juergen Gross wrote:
>> docs/misc/xenstore.txt states that xenstored will use "0" as a valid
>> transaction id after 2^32 transactions. This is not true. Remove that
>> statement.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Can you point me to the relevant code snippet? Better still I would like
> to see why it is the case in commit message.

Sure: tools/xenstore/xenstored_transaction.c

do_transaction_start():
...
        /* Pick an unused transaction identifier. */
        do {
                trans->id = conn->next_transaction_id;
                exists = transaction_lookup(conn,
conn->next_transaction_id++);
        } while (!IS_ERR(exists));

It should be noted here that conn->next_transaction_id is initialized
to be 0. So the error would occur for the first transaction, too.


Juergen

> 
>> ---
>>  docs/misc/xenstore.txt | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/docs/misc/xenstore.txt b/docs/misc/xenstore.txt
>> index c9f4a05..ae1b6a8 100644
>> --- a/docs/misc/xenstore.txt
>> +++ b/docs/misc/xenstore.txt
>> @@ -229,8 +229,6 @@ TRANSACTION_START	|			<transid>|
>>  	tx_id request header field.  When transaction is started whole
>>  	db is copied; reads and writes happen on the copy.
>>  	It is not legal to send non-0 tx_id in TRANSACTION_START.
>> -	Currently xenstored has the bug that after 2^32 transactions
>> -	it will allocate the transid 0 for an actual transaction.
>>  
>>  TRANSACTION_END		T|
>>  TRANSACTION_END		F|
>> -- 
>> 2.6.6
>>
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] docs: remove wrong statement about bug in xenstore
  2016-10-24 11:49   ` Juergen Gross
@ 2016-10-24 12:06     ` Andrew Cooper
  2016-10-24 12:18       ` Juergen Gross
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cooper @ 2016-10-24 12:06 UTC (permalink / raw)
  To: Juergen Gross, Wei Liu
  Cc: sstabellini, George.Dunlap, tim, ian.jackson, xen-devel, jbeulich

On 24/10/16 12:49, Juergen Gross wrote:
> On 24/10/16 13:41, Wei Liu wrote:
>> On Mon, Oct 24, 2016 at 01:27:17PM +0200, Juergen Gross wrote:
>>> docs/misc/xenstore.txt states that xenstored will use "0" as a valid
>>> transaction id after 2^32 transactions. This is not true. Remove that
>>> statement.
>>>
>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> Can you point me to the relevant code snippet? Better still I would like
>> to see why it is the case in commit message.
> Sure: tools/xenstore/xenstored_transaction.c
>
> do_transaction_start():
> ...
>         /* Pick an unused transaction identifier. */
>         do {
>                 trans->id = conn->next_transaction_id;
>                 exists = transaction_lookup(conn,
> conn->next_transaction_id++);
>         } while (!IS_ERR(exists));
>
> It should be noted here that conn->next_transaction_id is initialized
> to be 0. So the error would occur for the first transaction, too.

Cxenstored isn't the only xenstored implementation, and I can't see
anything in the Ocaml version which mitigates this issue.  Furthermore,
because Ocaml's int is 31 bits or 63 bits, I suspect a 64bit oxenstored
will become unusable when the transaction id hits 4 billion and an a
truncation occurs when writing the id into the ring.  A 32bit oxenstored
only uses half the available transaction id space, and does wrap around
to 0.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] docs: remove wrong statement about bug in xenstore
  2016-10-24 12:06     ` Andrew Cooper
@ 2016-10-24 12:18       ` Juergen Gross
  2016-10-24 13:02         ` Wei Liu
  0 siblings, 1 reply; 7+ messages in thread
From: Juergen Gross @ 2016-10-24 12:18 UTC (permalink / raw)
  To: Andrew Cooper, Wei Liu
  Cc: sstabellini, George.Dunlap, tim, ian.jackson, xen-devel, jbeulich

On 24/10/16 14:06, Andrew Cooper wrote:
> On 24/10/16 12:49, Juergen Gross wrote:
>> On 24/10/16 13:41, Wei Liu wrote:
>>> On Mon, Oct 24, 2016 at 01:27:17PM +0200, Juergen Gross wrote:
>>>> docs/misc/xenstore.txt states that xenstored will use "0" as a valid
>>>> transaction id after 2^32 transactions. This is not true. Remove that
>>>> statement.
>>>>
>>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>> Can you point me to the relevant code snippet? Better still I would like
>>> to see why it is the case in commit message.
>> Sure: tools/xenstore/xenstored_transaction.c
>>
>> do_transaction_start():
>> ...
>>         /* Pick an unused transaction identifier. */
>>         do {
>>                 trans->id = conn->next_transaction_id;
>>                 exists = transaction_lookup(conn,
>> conn->next_transaction_id++);
>>         } while (!IS_ERR(exists));
>>
>> It should be noted here that conn->next_transaction_id is initialized
>> to be 0. So the error would occur for the first transaction, too.
> 
> Cxenstored isn't the only xenstored implementation, and I can't see
> anything in the Ocaml version which mitigates this issue.  Furthermore,
> because Ocaml's int is 31 bits or 63 bits, I suspect a 64bit oxenstored
> will become unusable when the transaction id hits 4 billion and an a
> truncation occurs when writing the id into the ring.  A 32bit oxenstored
> only uses half the available transaction id space, and does wrap around
> to 0.

Okay, so either oxenstored should be corrected by some ocaml capable
developer, or I can send a patch which will limit the bug statement to
oxenstored.

Such a simple to fix problem should not be just mentioned in some text
file, but it should be fixed! Leaving the text unmodified is no option
IMHO.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] docs: remove wrong statement about bug in xenstore
  2016-10-24 12:18       ` Juergen Gross
@ 2016-10-24 13:02         ` Wei Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Liu @ 2016-10-24 13:02 UTC (permalink / raw)
  To: Juergen Gross
  Cc: tim, sstabellini, Wei Liu, George.Dunlap, Andrew Cooper,
	ian.jackson, xen-devel, jbeulich

On Mon, Oct 24, 2016 at 02:18:17PM +0200, Juergen Gross wrote:
> On 24/10/16 14:06, Andrew Cooper wrote:
> > On 24/10/16 12:49, Juergen Gross wrote:
> >> On 24/10/16 13:41, Wei Liu wrote:
> >>> On Mon, Oct 24, 2016 at 01:27:17PM +0200, Juergen Gross wrote:
> >>>> docs/misc/xenstore.txt states that xenstored will use "0" as a valid
> >>>> transaction id after 2^32 transactions. This is not true. Remove that
> >>>> statement.
> >>>>
> >>>> Signed-off-by: Juergen Gross <jgross@suse.com>
> >>> Can you point me to the relevant code snippet? Better still I would like
> >>> to see why it is the case in commit message.
> >> Sure: tools/xenstore/xenstored_transaction.c
> >>
> >> do_transaction_start():
> >> ...
> >>         /* Pick an unused transaction identifier. */
> >>         do {
> >>                 trans->id = conn->next_transaction_id;
> >>                 exists = transaction_lookup(conn,
> >> conn->next_transaction_id++);
> >>         } while (!IS_ERR(exists));
> >>
> >> It should be noted here that conn->next_transaction_id is initialized
> >> to be 0. So the error would occur for the first transaction, too.
> > 
> > Cxenstored isn't the only xenstored implementation, and I can't see
> > anything in the Ocaml version which mitigates this issue.  Furthermore,
> > because Ocaml's int is 31 bits or 63 bits, I suspect a 64bit oxenstored
> > will become unusable when the transaction id hits 4 billion and an a
> > truncation occurs when writing the id into the ring.  A 32bit oxenstored
> > only uses half the available transaction id space, and does wrap around
> > to 0.
> 
> Okay, so either oxenstored should be corrected by some ocaml capable
> developer, or I can send a patch which will limit the bug statement to
> oxenstored.
> 

A patch to spell out limitation on oxenstored works for me.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] docs: remove wrong statement about bug in xenstore
  2016-10-24 11:27 [PATCH] docs: remove wrong statement about bug in xenstore Juergen Gross
  2016-10-24 11:41 ` Wei Liu
@ 2016-10-26 12:02 ` Wei Liu
  1 sibling, 0 replies; 7+ messages in thread
From: Wei Liu @ 2016-10-26 12:02 UTC (permalink / raw)
  To: Juergen Gross
  Cc: tim, sstabellini, wei.liu2, George.Dunlap, andrew.cooper3,
	ian.jackson, xen-devel, jbeulich

On Mon, Oct 24, 2016 at 01:27:17PM +0200, Juergen Gross wrote:
> docs/misc/xenstore.txt states that xenstored will use "0" as a valid
> transaction id after 2^32 transactions. This is not true. Remove that
> statement.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Applied.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-10-26 12:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-24 11:27 [PATCH] docs: remove wrong statement about bug in xenstore Juergen Gross
2016-10-24 11:41 ` Wei Liu
2016-10-24 11:49   ` Juergen Gross
2016-10-24 12:06     ` Andrew Cooper
2016-10-24 12:18       ` Juergen Gross
2016-10-24 13:02         ` Wei Liu
2016-10-26 12:02 ` Wei Liu

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).