cgroups: fix flag checking in legacy mount paths

parent 7deb2834
...@@ -1725,7 +1725,7 @@ static int cg_legacy_mount_controllers(int cg_flags, struct hierarchy *h, ...@@ -1725,7 +1725,7 @@ static int cg_legacy_mount_controllers(int cg_flags, struct hierarchy *h,
int ret, remount_flags; int ret, remount_flags;
int flags = MS_BIND; int flags = MS_BIND;
if (cg_flags == LXC_AUTO_CGROUP_RO || cg_flags == LXC_AUTO_CGROUP_MIXED) { if ((cg_flags & LXC_AUTO_CGROUP_RO) || (cg_flags & LXC_AUTO_CGROUP_MIXED)) {
ret = mount(controllerpath, controllerpath, "cgroup", MS_BIND, NULL); ret = mount(controllerpath, controllerpath, "cgroup", MS_BIND, NULL);
if (ret < 0) if (ret < 0)
return log_error_errno(-1, errno, "Failed to bind mount \"%s\" onto \"%s\"", return log_error_errno(-1, errno, "Failed to bind mount \"%s\" onto \"%s\"",
...@@ -1745,7 +1745,7 @@ static int cg_legacy_mount_controllers(int cg_flags, struct hierarchy *h, ...@@ -1745,7 +1745,7 @@ static int cg_legacy_mount_controllers(int cg_flags, struct hierarchy *h,
sourcepath = must_make_path(h->mountpoint, h->container_base_path, sourcepath = must_make_path(h->mountpoint, h->container_base_path,
container_cgroup, NULL); container_cgroup, NULL);
if (cg_flags == LXC_AUTO_CGROUP_RO) if ((cg_flags & LXC_AUTO_CGROUP_RO))
flags |= MS_RDONLY; flags |= MS_RDONLY;
ret = mount(sourcepath, cgpath, "cgroup", flags, NULL); ret = mount(sourcepath, cgpath, "cgroup", flags, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment