Skip to contentSkip to conversation

docs: remove wrong statement about bug in xenstore

PATCH Applied Juergen Gross 3 participants 7 messages Oct 24, 2016 – Oct 26, 2016

v1 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: remove wrong statement about bug in xenstore

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.

---
 docs/misc/xenstore.txt | 2 --
 1 file changed, 2 deletions(-)
docs/misc/xenstore.txt +0 -2
index c9f4a05..ae1b6a8 100644
@@ -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|
Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 5 lines · Juergen Gross

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.

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

Quoted 20 lines
---
 docs/misc/xenstore.txt | 2 --
 1 file changed, 2 deletions(-)
docs/misc/xenstore.txt +0 -2
index c9f4a05..ae1b6a8 100644
@@ -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|
Signature · 1 line
2.6.6

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 9 lines · Wei Liu
Quoted 5 lines · Juergen Gross

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.

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

Quoted 16 lines
Quoted 16 lines
---
 docs/misc/xenstore.txt | 2 --
 1 file changed, 2 deletions(-)
docs/misc/xenstore.txt +0 -2
index c9f4a05..ae1b6a8 100644
@@ -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.
 
Quoted 6 lines
Quoted 5 lines
docs/misc/xenstore.txt +0 -0
 TRANSACTION_END		T|
 TRANSACTION_END		F|
Signature · 1 line
2.6.6

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw
Quoted 20 lines · Juergen Gross
Quoted 8 lines · Wei Liu
Quoted 5 lines · Juergen Gross

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.

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));
Quoted 2 lines

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
[email protected]
https://lists.xen.org/xen-devel

#4 lore raw
Quoted 24 lines · Andrew Cooper
Quoted 20 lines · Juergen Gross
Quoted 8 lines · Wei Liu
Quoted 5 lines · Juergen Gross

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.

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));
Quoted 2 lines

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.

Quoted 7 lines

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
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw
Quoted 33 lines · Juergen Gross
Quoted 24 lines · Andrew Cooper
Quoted 20 lines · Juergen Gross
Quoted 8 lines · Wei Liu
Quoted 5 lines · Juergen Gross

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.

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));
Quoted 2 lines

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.

Quoted 7 lines

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.

Quoted 4 lines

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
[email protected]
https://lists.xen.org/xen-devel