[lxc-devel] [lxc/master] cgfsng: don't pre-calculate path

hallyn on Github lxc-bot at linuxcontainers.org
Sat Jul 2 02:21:54 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 626 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160702/36ec4c11/attachment.bin>
-------------- next part --------------
From 0b6ca6e39b63fe37ff66ffcf1c5e13a3a0b330c0 Mon Sep 17 00:00:00 2001
From: Serge Hallyn <serge at hallyn.com>
Date: Fri, 1 Jul 2016 21:18:38 -0500
Subject: [PATCH] cgfsng: don't pre-calculate path

First, we're doing this so long a there is any cgroup config item -
even if no devices ones.  Then if devices is not available we fail.
This was leading to Rob E's mysterious startup failures.

Secondly, we're not even using this info.  The user was removed
awhile back.

Signed-off-by: Serge Hallyn <serge at hallyn.com>
---
 src/lxc/cgfsng.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/src/lxc/cgfsng.c b/src/lxc/cgfsng.c
index 1e72347..0ea7b39 100644
--- a/src/lxc/cgfsng.c
+++ b/src/lxc/cgfsng.c
@@ -1627,8 +1627,6 @@ static bool cgfsng_setup_limits(void *hdata, struct lxc_list *cgroup_settings,
 	struct cgfsng_handler_data *d = hdata;
 	struct lxc_list *iterator, *sorted_cgroup_settings, *next;
 	struct lxc_cgroup *cg;
-	struct hierarchy *h;
-	char *listpath = NULL;
 	bool ret = false;
 
 	if (lxc_list_empty(cgroup_settings))
@@ -1639,15 +1637,6 @@ static bool cgfsng_setup_limits(void *hdata, struct lxc_list *cgroup_settings,
 		return false;
 	}
 
-	if (do_devices) {
-		h = get_hierarchy("devices");
-		if (!h) {
-			ERROR("No devices cgroup setup for %s", d->name);
-			return false;
-		}
-		listpath = must_make_path(h->fullcgpath, "devices.list", NULL);
-	}
-
 	lxc_list_for_each(iterator, sorted_cgroup_settings) {
 		cg = iterator->elem;
 
@@ -1670,7 +1659,6 @@ static bool cgfsng_setup_limits(void *hdata, struct lxc_list *cgroup_settings,
 	ret = true;
 	INFO("cgroup has been setup");
 out:
-	free(listpath);
 	lxc_list_for_each_safe(iterator, sorted_cgroup_settings, next) {
 		lxc_list_del(iterator);
 		free(iterator);


More information about the lxc-devel mailing list