[lxc-devel] [lxc/master] cgfsng: write cpuset.mems of correct ancestor

brauner on Github lxc-bot at linuxcontainers.org
Thu Jun 20 17:38:23 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 424 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190620/9db0d3a8/attachment.bin>
-------------- next part --------------
From f68ea354f462d5425bf2237ae2b6011071b4859a Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Thu, 20 Jun 2019 19:37:09 +0200
Subject: [PATCH] cgfsng: write cpuset.mems of correct ancestor

Reported-by: Free Ekanayaka <free.ekanayaka at canonical.com>
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 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 9c05fbbe3d..62b7a87b03 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);


More information about the lxc-devel mailing list