summaryrefslogtreecommitdiff
path: root/src/nspawn/nspawn-mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nspawn/nspawn-mount.c')
-rw-r--r--src/nspawn/nspawn-mount.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c
index 68d844bfaf..f3fb0922c3 100644
--- a/src/nspawn/nspawn-mount.c
+++ b/src/nspawn/nspawn-mount.c
@@ -284,20 +284,8 @@ int mount_sysfs(const char *dest) {
x = prefix_roota(top, "/fs/kdbus");
(void) mkdir_p(x, 0755);
- /* We need to ensure that /sys/fs/cgroup exists before we remount /sys read-only.
- *
- * If !use_cgns, then this was already done by the outer child; so we only need to do it here it if use_cgns.
- * This function doesn't know whether use_cgns, but !cg_ns_supported()⇒!use_cgns, so we can "optimize" the case
- * where we _know_ !use_cgns, and deal with a no-op mkdir_p() in the false-positive where cgns_supported() but
- * !use_cgns.
- *
- * But is it really much of an optimization? We're potentially spending an access(2) (cg_ns_supported() could
- * be cached from a previous call) to potentially save an lstat(2) and mkdir(2); and all of them are on virtual
- * fileystems, so they should all be pretty cheap. */
- if (cg_ns_supported()) { /* if (use_cgns) { */
- x = prefix_roota(top, "/fs/cgroup");
- (void) mkdir_p(x, 0755);
- }
+ x = prefix_roota(top, "/fs/cgroup");
+ (void) mkdir_p(x, 0755);
return mount_verbose(LOG_ERR, NULL, top, NULL,
MS_BIND|MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REMOUNT, NULL);