[systemd-devel] [PATCH] systemd: fall back to mounting /sys/fs/cgroup sans xattr

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Mon Apr 22 19:10:51 PDT 2013


xattrs on cgroup fs were added back in v3.6-rc3-3-g03b1cde. But
we support kernels >= 2.6.39, and we also support kernels compiled
w/o xattr support, so it's better to fall back to mounting without
xattr support.
---
Hi Colin,                                                                                                                        

in follow up to our IRC discussion, could you check if this works for
you?  I tested it with Fubuntu 3.4.11 kernel (rpm.pbone.net FTW!), and
I didn't see any adverse effects. It would be great to know that it
also fixes the problem you were observing.

At debug level, a message will be printed, but I think that's fine.

 src/core/mount-setup.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 56d358b..a0fd7a0 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -68,12 +68,6 @@ typedef struct MountPoint {
  * other ones we can delay until SELinux and IMA are loaded. */
 #define N_EARLY_MOUNT 5
 
-#ifdef HAVE_XATTR
-#  define FS_XATTR_OPT ",xattr"
-#else
-#  define FS_XATTR_OPT ""
-#endif
-
 static const MountPoint mount_table[] = {
         { "proc",       "/proc",                     "proc",       NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
           NULL,       MNT_FATAL|MNT_IN_CONTAINER },
@@ -93,7 +87,11 @@ static const MountPoint mount_table[] = {
           NULL,       MNT_FATAL|MNT_IN_CONTAINER },
         { "tmpfs",      "/sys/fs/cgroup",            "tmpfs",      "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME,
           NULL,       MNT_IN_CONTAINER },
-        { "cgroup",     "/sys/fs/cgroup/systemd",    "cgroup",     "none,name=systemd" FS_XATTR_OPT, MS_NOSUID|MS_NOEXEC|MS_NODEV,
+#ifdef HAVE_XATTR
+        { "cgroup",     "/sys/fs/cgroup/systemd",    "cgroup",     "none,name=systemd,xattr", MS_NOSUID|MS_NOEXEC|MS_NODEV,
+          NULL,       MNT_IN_CONTAINER },
+#endif
+        { "cgroup",     "/sys/fs/cgroup/systemd",    "cgroup",     "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV,
           NULL,       MNT_IN_CONTAINER },
         { "pstore",     "/sys/fs/pstore",            "pstore",     NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
           NULL,       MNT_NONE },
-- 
1.8.1.4



More information about the systemd-devel mailing list