From f68ea354f462d5425bf2237ae2b6011071b4859a Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Thu, 20 Jun 2019 19:37:09 +0200 Subject: [PATCH] cgfsng: write cpuset.mems of correct ancestor Reported-by: Free Ekanayaka Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 9c05fbbe3..62b7a87b0 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -400,6 +400,7 @@ static bool cg_legacy_filter_and_set_cpus(char *path, bool am_initialized) oldv = *lastslash; *lastslash = '\0'; fpath = must_make_path(path, "cpuset.cpus", NULL); + *lastslash = oldv; posscpus = read_file(fpath); if (!posscpus) { SYSERROR("Failed to read file \"%s\"", fpath); @@ -504,7 +505,6 @@ static bool cg_legacy_filter_and_set_cpus(char *path, bool am_initialized) copy_parent: if (!am_initialized) { - *lastslash = oldv; fpath = must_make_path(path, "cpuset.cpus", NULL); ret = lxc_write_to_file(fpath, cpulist, strlen(cpulist), false, 0666); -- 2.39.2