[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xenstore: fix add_change_node()



commit dc6d67804fbf043e53f8f7805c7a39b279a47f5a
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Thu Oct 27 11:55:52 2016 +0200
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Mon Oct 31 10:18:02 2016 +0000

    xenstore: fix add_change_node()
    
    add_change_node() in xenstored is used to add a modified node to the
    list of changed nodes of one transaction. It is being called with the
    recurse parameter set to true when removing a node in order to get
    watches for children of the node fired at transaction end, too.
    
    If, however, the node to be deleted had been modified in the same
    transaction the recurse parameter of add_change_node() is lost as
    an entry already in the list of the changed nodes won't be entered
    again.
    
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/xenstore/xenstored_transaction.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/xenstored_transaction.c 
b/tools/xenstore/xenstored_transaction.c
index 34720fa..84cb0bf 100644
--- a/tools/xenstore/xenstored_transaction.c
+++ b/tools/xenstore/xenstored_transaction.c
@@ -102,9 +102,13 @@ void add_change_node(struct transaction *trans, const char 
*node, bool recurse)
                return;
        }
 
-       list_for_each_entry(i, &trans->changes, list)
-               if (streq(i->node, node))
+       list_for_each_entry(i, &trans->changes, list) {
+               if (streq(i->node, node)) {
+                       if (recurse)
+                               i->recurse = recurse;
                        return;
+               }
+       }
 
        i = talloc(trans, struct changed_node);
        i->node = talloc_strdup(i, node);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.