From e2302e0109bf13673309c52ff4cb94f22b22b282 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 17 Aug 2010 10:58:11 -0400 Subject: [PATCH] create a /sys/fs/cgroup mountpoint for cgroupfs --- ...e-sys-fs-cgroup-to-mount-cgroupfs-on.patch | 56 +++++++++++++++++++ kernel.spec | 7 +++ 2 files changed, 63 insertions(+) create mode 100644 create-sys-fs-cgroup-to-mount-cgroupfs-on.patch diff --git a/create-sys-fs-cgroup-to-mount-cgroupfs-on.patch b/create-sys-fs-cgroup-to-mount-cgroupfs-on.patch new file mode 100644 index 000000000..e1788a316 --- /dev/null +++ b/create-sys-fs-cgroup-to-mount-cgroupfs-on.patch @@ -0,0 +1,56 @@ +From: Greg KH +Date: Thu, 5 Aug 2010 20:53:35 +0000 (-0700) +Subject: cgroupfs: create /sys/fs/cgroup to mount cgroupfs on +X-Git-Tag: v2.6.36-rc1~521^2~7 +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=676db4af043014e852f67ba0349dae0071bd11f3 + +cgroupfs: create /sys/fs/cgroup to mount cgroupfs on + +We really shouldn't be asking userspace to create new root filesystems. +So follow along with all of the other in-kernel filesystems, and provide +a mount point in sysfs. + +For cgroupfs, this should be in /sys/fs/cgroup/ This change provides +that mount point when the cgroup filesystem is registered in the kernel. + +Acked-by: Paul Menage +Acked-by: Dhaval Giani +Cc: Li Zefan +Cc: Lennart Poettering +Cc: Kay Sievers +Signed-off-by: Greg Kroah-Hartman +--- + +diff --git a/kernel/cgroup.c b/kernel/cgroup.c +index a8ce099..d83cab0 100644 +--- a/kernel/cgroup.c ++++ b/kernel/cgroup.c +@@ -1623,6 +1623,8 @@ static struct file_system_type cgroup_fs_type = { + .kill_sb = cgroup_kill_sb, + }; + ++static struct kobject *cgroup_kobj; ++ + static inline struct cgroup *__d_cgrp(struct dentry *dentry) + { + return dentry->d_fsdata; +@@ -3894,9 +3896,18 @@ int __init cgroup_init(void) + hhead = css_set_hash(init_css_set.subsys); + hlist_add_head(&init_css_set.hlist, hhead); + BUG_ON(!init_root_id(&rootnode)); ++ ++ cgroup_kobj = kobject_create_and_add("cgroup", fs_kobj); ++ if (!cgroup_kobj) { ++ err = -ENOMEM; ++ goto out; ++ } ++ + err = register_filesystem(&cgroup_fs_type); +- if (err < 0) ++ if (err < 0) { ++ kobject_put(cgroup_kobj); + goto out; ++ } + + proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations); + diff --git a/kernel.spec b/kernel.spec index 711c5fb6d..b300e45d5 100644 --- a/kernel.spec +++ b/kernel.spec @@ -612,6 +612,8 @@ Patch202: linux-2.6-debug-taint-vm.patch Patch203: linux-2.6-debug-vm-would-have-oomkilled.patch Patch204: linux-2.6-debug-always-inline-kzalloc.patch +Patch300: create-sys-fs-cgroup-to-mount-cgroupfs-on.patch + Patch380: linux-2.6-defaults-pci_no_msi.patch Patch383: linux-2.6-defaults-aspm.patch Patch384: pci-acpi-disable-aspm-if-no-osc.patch @@ -1237,6 +1239,7 @@ ApplyPatch linux-2.6-silence-fbcon-logo.patch #ApplyPatch linux-2.6-sparc-selinux-mprotect-checks.patch # Changes to upstream defaults. +ApplyPatch create-sys-fs-cgroup-to-mount-cgroupfs-on.patch # /dev/crash driver. @@ -1888,6 +1891,10 @@ fi # and build. %changelog +* Tue Aug 17 2010 Kyle McMartin +- Move cgroup fs to /sys/fs/cgroup instead of /cgroup in accordance with + upstream change post 2.6.35. + * Tue Aug 17 2010 Kyle McMartin - Touch .scmversion in the kernel top level to prevent scripts/setlocalversion from recursing into our fedpkg git tree and trying to decide whether the