lxc/0046-Do-not-test-cgroup-writeable.patch
LiFeng c1c967d9bc lxc: make lxc-libs package
Signed-off-by: LiFeng <lifeng68@huawei.com>
2020-02-14 06:13:22 -05:00

49 lines
1.5 KiB
Diff

From ef7488f89bbdc933e2a84744092150939bef7c4c Mon Sep 17 00:00:00 2001
From: LiFeng <lifeng68@huawei.com>
Date: Thu, 17 Jan 2019 03:49:16 -0500
Subject: [PATCH 046/139] Do not test cgroup writeable
If we run isulad in docker without cgroup namespace, the base_cgroup will be docker/XXX..,
mountpoint+base_cgroup may be not exist
Signed-off-by: LiFeng <lifeng68@huawei.com>
---
src/lxc/cgroups/cgfsng.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index 47b12a6..6bfa693 100644
--- a/src/lxc/cgroups/cgfsng.c
+++ b/src/lxc/cgroups/cgfsng.c
@@ -581,7 +581,7 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname)
if (slash)
*slash = '/';
- ret = mkdir(cgpath, 0755);
+ ret = mkdir_p(cgpath, 0755);
if (ret < 0) {
if (errno != EEXIST) {
SYSERROR("Failed to create directory \"%s\"", cgpath);
@@ -2489,13 +2489,17 @@ static bool cg_hybrid_init(struct cgroup_ops *ops)
trim(base_cgroup);
prune_init_scope(base_cgroup);
+
+ /* isulad:
+ * do not test writeable, if we run isulad in docker without cgroup namespace.
+ * the base_cgroup will be docker/XXX.., mountpoint+base_cgroup may be not exist
if (type == CGROUP2_SUPER_MAGIC)
writeable = test_writeable_v2(mountpoint, base_cgroup);
else
writeable = test_writeable_v1(mountpoint, base_cgroup);
if (!writeable)
goto next;
-
+ */
if (type == CGROUP2_SUPER_MAGIC) {
char *cgv2_ctrl_path;
--
1.8.3.1