xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Juergen Gross <jgross@suse.com>, Wei Liu <wei.liu2@citrix.com>
Cc: sstabellini@kernel.org, George.Dunlap@eu.citrix.com, tim@xen.org,
	ian.jackson@eu.citrix.com, xen-devel@lists.xen.org,
	jbeulich@suse.com
Subject: Re: [PATCH] docs: remove wrong statement about bug in xenstore
Date: Mon, 24 Oct 2016 13:06:06 +0100	[thread overview]
Message-ID: <b1dd9eb2-25f9-15e4-8db3-b715a05c74c7@citrix.com> (raw)
In-Reply-To: <2584000e-1409-dad7-0894-7243b3f6ea1b@suse.com>

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

  reply	other threads:[~2016-10-24 12:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-10-24 12:18       ` Juergen Gross
2016-10-24 13:02         ` Wei Liu
2016-10-26 12:02 ` Wei Liu

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=b1dd9eb2-25f9-15e4-8db3-b715a05c74c7@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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).