瀏覽代碼

jail: cgroup hack: rewrite cgroup -> cgroup2

"I'm sure you said cgroup2"

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Daniel Golle 3 年之前
父節點
當前提交
b22e6254df
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      jail/fs.c

+ 2 - 1
jail/fs.c

@@ -149,7 +149,8 @@ static int do_mount(const char *root, const char *orig_source, const char *targe
 		mountflags |= MS_REMOUNT;
 	}
 
-	if (mount(source?:(is_bind?new:NULL), new, filesystemtype, mountflags, optstr)) {
+	const char *hack_fstype = ((!filesystemtype || strcmp(filesystemtype, "cgroup"))?filesystemtype:"cgroup2");
+	if (mount(source?:(is_bind?new:NULL), new, hack_fstype, mountflags, optstr)) {
 		if (error)
 			ERROR("failed to mount %s %s: %m\n", source, new);