SHA256
1
0
forked from pool/lxcfs

Accepting request 407597 from home:chbrauner:branches:Virtualization:containers

OBS-URL: https://build.opensuse.org/request/show/407597
OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxcfs?expand=0&rev=2
This commit is contained in:
Jordi Massaguer 2016-07-11 09:10:03 +00:00 committed by Git OBS Bridge
parent b086eb9d1e
commit f6e0638b0f
3 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,60 @@
From a67719f64d07d7fee96b1e145a03659fe4db0c6e Mon Sep 17 00:00:00 2001
From: Christian Brauner <cbrauner@suse.de>
Date: Sat, 9 Jul 2016 13:19:06 +0200
Subject: [PATCH] skip empty entries under /proc/self/cgroup
If cgroupv2 is enabled either alone or together with legacy hierarchies
/proc/self/cgroup can contain entries of the form:
0::/
This will cause lxcfs to fail the cgroup mounts because it parses out the empty
string "" and later on passes it to mount(). Let's skip such entries.
Signed-off-by: Christian Brauner <cbrauner@suse.de>
---
bindings.c | 8 ++++++++
lxcfs.c | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/bindings.c b/bindings.c
index cb98e12..8186ca9 100644
--- a/bindings.c
+++ b/bindings.c
@@ -3951,6 +3951,14 @@ static void __attribute__((constructor)) collect_subsystems(void)
goto out;
*p2 = '\0';
+ /* With cgroupv2 /proc/self/cgroup can contain entries of the
+ * form: 0::/ This will cause lxcfs to fail the cgroup mounts
+ * because it parses out the empty string "" and later on passes
+ * it to mount(). Let's skip such entries.
+ */
+ if (!strcmp(p, ""))
+ continue;
+
if (!store_hierarchy(line, p))
goto out;
}
diff --git a/lxcfs.c b/lxcfs.c
index 7455267..1d19a10 100644
--- a/lxcfs.c
+++ b/lxcfs.c
@@ -859,6 +859,14 @@ static bool do_mount_cgroups(void)
goto out;
*p2 = '\0';
+ /* With cgroupv2 /proc/self/cgroup can contain entries of the
+ * form: 0::/ This will cause lxcfs to fail the cgroup mounts
+ * because it parses out the empty string "" and later on passes
+ * it to mount(). Let's skip such entries.
+ */
+ if (!strcmp(p, ""))
+ continue;
+
if (!do_mount_cgroup(p))
goto out;
}
--
2.8.4

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sun Jul 10 09:34:39 UTC 2016 - cbrauner@suse.com
- add 0001-skip-empty-entries-under-proc-self-cgroup.patch
-------------------------------------------------------------------
Thu Jul 7 16:13:57 UTC 2016 - cbrauner@suse.de

View File

@ -23,6 +23,7 @@ Summary: FUSE filesystem for LXC
Url: http://linuxcontainers.org
Group: System/Management
Source: https://linuxcontainers.org/downloads/%{name}/%{name}-%{version}.tar.gz
Patch: 0001-skip-empty-entries-under-proc-self-cgroup.patch
BuildRequires: pkg-config
BuildRequires: pkgconfig(fuse)
BuildRequires: pam-devel
@ -58,6 +59,7 @@ command line.
%prep
%setup -q
%patch -p1
%build
%configure --with-distro=suse