]> xenbits.xensource.com Git - xen.git/commit
tools/xenstore: fix node accounting after failed node creation
authorJuergen Gross <jgross@suse.com>
Thu, 11 Jun 2020 14:12:39 +0000 (16:12 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 15 Dec 2020 13:43:03 +0000 (14:43 +0100)
commit77d6b2b600dfcfe274ec6a553c3fa700c8b6cac5
tree4c159e4afcb703508a2f5b92b75179d9b26a04e8
parenta043a64bd9415042e680a10ac75c34dc4fe08240
tools/xenstore: fix node accounting after failed node creation

When a node creation fails the number of nodes of the domain should be
the same as before the failed node creation. In case of failure when
trying to create a node requiring to create one or more intermediate
nodes as well (e.g. when /a/b/c/d is to be created, but /a/b isn't
existing yet) it might happen that the number of nodes of the creating
domain is not reset to the value it had before.

So move the quota accounting out of construct_node() and into the node
write loop in create_node() in order to be able to undo the accounting
in case of an error in the intermediate node destructor.

This is part of XSA-115.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Acked-by: Julien Grall <jgrall@amazon.com>
tools/xenstore/xenstored_core.c