From: Juergen Gross Date: Mon, 20 Mar 2017 08:00:20 +0000 (+0100) Subject: xenstore: set correct error code when violating quota X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2427 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ec4abec2098ca59b2cb83b45843da21f65da79d7;p=xen.git xenstore: set correct error code when violating quota When the number of permitted xenstore entries for a domain is being exceeded the operation trying to create a new entry is denied. Unfortunately errno isn't being set in this case so the error code returned to the client is undefined. Set errno to ENOSPC in this case. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index 5c659d87c3..ed803458ef 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -937,8 +937,10 @@ static struct node *construct_node(struct connection *conn, const void *ctx, if (!parent) return NULL; - if (domain_entry(conn) >= quota_nb_entry_per_domain) + if (domain_entry(conn) >= quota_nb_entry_per_domain) { + errno = ENOSPC; return NULL; + } /* Add child to parent. */ base = basename(name);