]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xenstore: set correct error code when violating quota
authorJuergen Gross <jgross@suse.com>
Mon, 20 Mar 2017 08:00:20 +0000 (09:00 +0100)
committerWei Liu <wei.liu2@citrix.com>
Wed, 22 Mar 2017 11:23:10 +0000 (11:23 +0000)
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 <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/xenstore/xenstored_core.c

index 5c659d87c3d92f024be4387901ef86c016a3109f..ed803458efaab5e36c1ed6c7b6213f42b421650d 100644 (file)
@@ -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);