]> git.proxmox.com Git - mirror_lxc.git/commitdiff
cgfsng: write cpuset.mems of correct ancestor
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 20 Jun 2019 17:37:09 +0000 (19:37 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 20 Jun 2019 17:37:09 +0000 (19:37 +0200)
Reported-by: Free Ekanayaka <free.ekanayaka@canonical.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 9c05fbbe3d8f1051ef5e1008f6d3939887ad73fc..62b7a87b03b3b8c53e5bcdbc3e193d03ba664e1b 100644 (file)
@@ -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);