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

[xen master] tools/xenstore: take transaction internal nodes into account for quota



commit 887b576ba90b741d6afcfbefbbb7ba9d71d42797
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Tue May 30 10:24:11 2023 +0200
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Wed Jun 7 12:10:31 2023 +0100

    tools/xenstore: take transaction internal nodes into account for quota
    
    The accounting for the number of nodes of a domain in an active
    transaction is not working correctly, as it is checking the node quota
    only against the number of nodes outside the transaction.
    
    This can result in the transaction finally failing, as node quota is
    checked at the end of the transaction again.
    
    On the other hand even in a transaction deleting many nodes, new nodes
    might not be creatable, in case the node quota was already reached at
    the start of the transaction.
    
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 tools/xenstore/xenstored_domain.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstored_domain.c 
b/tools/xenstore/xenstored_domain.c
index aeb7595ae1..2b85bafeee 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -1115,9 +1115,8 @@ int domain_nbentry_fix(unsigned int domid, int num, bool 
update)
 
 int domain_nbentry(struct connection *conn)
 {
-       return (domain_is_unprivileged(conn))
-               ? conn->domain->nbentry
-               : 0;
+       return domain_is_unprivileged(conn)
+              ? domain_nbentry_add(conn, conn->id, 0, true) : 0;
 }
 
 static bool domain_chk_quota(struct domain *domain, int mem)
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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