From: Wei Liu <wei.liu2@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: tim@xen.org, sstabellini@kernel.org, wei.liu2@citrix.com,
George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
ian.jackson@eu.citrix.com, xen-devel@lists.xen.org,
jbeulich@suse.com
Subject: Re: [PATCH v3 02/12] xenstore: call add_change_node() directly when writing node
Date: Sat, 12 Nov 2016 15:10:43 +0000 [thread overview]
Message-ID: <20161112151043.GE23528@citrix.com> (raw)
In-Reply-To: <1478851210-6251-3-git-send-email-jgross@suse.com>
On Fri, Nov 11, 2016 at 09:00:00AM +0100, Juergen Gross wrote:
> Instead of calling add_change_node() at places where write_node() is
> called, do that inside write_node().
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
There seems to be a subtle change in behaviour -- previously in
create_node, there is no add_chnage_node called. Now it has.
> ---
> tools/xenstore/xenstored_core.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
> index de1a9b4..1354387 100644
> --- a/tools/xenstore/xenstored_core.c
> +++ b/tools/xenstore/xenstored_core.c
> @@ -456,7 +456,7 @@ static struct node *read_node(struct connection *conn, const void *ctx,
> return node;
> }
>
> -static bool write_node(struct connection *conn, const struct node *node)
> +static bool write_node(struct connection *conn, struct node *node)
> {
> /*
> * conn will be null when this is called from manual_node.
> @@ -476,6 +476,8 @@ static bool write_node(struct connection *conn, const struct node *node)
> if (domain_is_unprivileged(conn) && data.dsize >= quota_max_entry_size)
> goto error;
>
> + add_change_node(conn, node, false);
> +
Another subtle change of behaviour -- there is another goto error after
this, which means the change is not made as far as the caller is
concerned if that path is taken.
Not saying that all these changes are wrong, but they are worth pointing
out and probably we should put the reasoning into commit message.
> data.dptr = talloc_size(node, data.dsize);
> ((uint32_t *)data.dptr)[0] = node->num_perms;
> ((uint32_t *)data.dptr)[1] = node->datalen;
> @@ -976,7 +978,6 @@ static void do_write(struct connection *conn, struct buffered_data *in)
> }
> }
>
> - add_change_node(conn, node, false);
> fire_watches(conn, in, name, false);
> send_ack(conn, XS_WRITE);
> }
> @@ -1007,7 +1008,6 @@ static void do_mkdir(struct connection *conn, struct buffered_data *in)
> send_error(conn, errno);
> return;
> }
> - add_change_node(conn, node, false);
> fire_watches(conn, in, name, false);
> }
> send_ack(conn, XS_MKDIR);
> @@ -1209,7 +1209,6 @@ static void do_set_perms(struct connection *conn, struct buffered_data *in)
> return;
> }
>
> - add_change_node(conn, node, false);
> fire_watches(conn, in, name, false);
> send_ack(conn, XS_SET_PERMS);
> }
> --
> 2.6.6
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-11-12 15:10 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-11 7:59 [PATCH v3 00/12] xenstore: support reading directory with many children Juergen Gross
2016-11-11 7:59 ` [PATCH v3 01/12] xenstore: modify add_change_node() parameter types Juergen Gross
2016-11-12 15:09 ` Wei Liu
2016-11-11 8:00 ` [PATCH v3 02/12] xenstore: call add_change_node() directly when writing node Juergen Gross
2016-11-12 15:10 ` Wei Liu [this message]
2016-11-13 10:50 ` Juergen Gross
2016-11-14 8:46 ` Wei Liu
2016-11-11 8:00 ` [PATCH v3 03/12] xenstore: use common tdb record header in xenstore Juergen Gross
2016-11-12 15:10 ` Wei Liu
2016-11-11 8:00 ` [PATCH v3 04/12] xenstore: add per-node generation counter Juergen Gross
2016-11-12 15:10 ` Wei Liu
2016-11-11 8:00 ` [PATCH v3 05/12] xenstore: add support for reading directory with many children Juergen Gross
2016-11-11 10:09 ` Jan Beulich
[not found] ` <5825A6D6020000780011DEA4@suse.com>
2016-11-11 10:43 ` Juergen Gross
2016-11-11 11:12 ` Jan Beulich
[not found] ` <5825B59B020000780011DF28@suse.com>
2016-11-11 11:15 ` Juergen Gross
2016-11-12 15:11 ` Wei Liu
2016-11-11 8:00 ` [PATCH v3 06/12] xenstore: support XS_DIRECTORY_PART in libxenstore Juergen Gross
2016-11-12 15:11 ` Wei Liu
2016-11-11 8:00 ` [PATCH v3 07/12] xenstore: use array for xenstore wire command handling Juergen Gross
2016-11-12 15:11 ` Wei Liu
2016-11-11 8:00 ` [PATCH v3 08/12] xenstore: let command functions return error or success Juergen Gross
2016-11-12 15:11 ` Wei Liu
2016-11-13 11:05 ` Juergen Gross
2016-11-11 8:00 ` [PATCH v3 09/12] xenstore: make functions static Juergen Gross
2016-11-11 13:02 ` Andrew Cooper
2016-11-11 13:19 ` Juergen Gross
2016-11-11 8:00 ` [PATCH v3 10/12] xenstore: add helper functions for wire argument parsing Juergen Gross
2016-11-12 15:11 ` Wei Liu
2016-11-11 8:00 ` [PATCH v3 11/12] xenstore: add small default data buffer to internal struct Juergen Gross
2016-11-12 15:11 ` Wei Liu
2016-11-11 8:00 ` [PATCH v3 12/12] xenstore: handle memory allocation failures in xenstored Juergen Gross
2016-11-11 11:07 ` Juergen Gross
2016-11-12 15:11 ` 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=20161112151043.GE23528@citrix.com \
--to=wei.liu2@citrix.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@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=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).