Hi Juergen,
Title: I can't find read_node_nocopy(). I found a read_node_const().
Which name did you intend to use?
On 24/07/2023 12:02, Juergen Gross wrote:
+static int read_node_helper(struct connection *conn, struct node *node)
+{
/* Data is binary blob (usually ascii, no nul). */
- node->data = node->perms + hdr->num_perms;
+ node->data = node->perms + node->hdr.num_perms;
/* Children is strings, nul separated. */
node->children = node->data + node->hdr.datalen;
if (domain_adjust_node_perms(node))
- goto error;
+ return -1;
You are either returning 0 or -1 which is then only used in if ( ... ).
Can we simply return a boolean (true for success, false for a failure)?
The rest LGTM.
/* If owner is gone reset currently accounted memory size. */
if (node->acc.domid != get_node_owner(node))
node->acc.memory = 0;
if (access_node(conn, node, NODE_ACCESS_READ, NULL))
+ return -1;
+
+ return 0;
+}
Cheers,
--
Julien Grall