From 65d29cbc57fccebdf553b01ba6e4694012d2469d Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Mon, 21 Nov 2016 22:31:39 +0100 Subject: [PATCH] cgroups: handle non-existent isolcpus file If the file "/sys/devices/system/cpu/isolated" doesn't exist, we can't just simply bail. We still need to check whether we need to copy the parents cpu settings. Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 285fd98ea..d3215d76c 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -454,6 +454,18 @@ static bool filter_and_set_cpus(char *path, bool am_initialized) if (!file_exists(__ISOL_CPUS)) { /* This system doesn't expose isolated cpus. */ DEBUG("Path: "__ISOL_CPUS" to read isolated cpus from does not exist.\n"); + cpulist = posscpus; + /* No isolated cpus but we weren't already initialized by + * someone. We should simply copy the parents cpuset.cpus + * values. + */ + if (!am_initialized) { + DEBUG("Copying cpuset of parent cgroup."); + goto copy_parent; + } + /* No isolated cpus but we were already initialized by someone. + * Nothing more to do for us. + */ goto on_success; } -- 2.47.2