]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/user.c
V4L/DVB (10191a): Update MAINTAINERS entries on media drivers
[linux-2.6-omap-h63xx.git] / kernel / user.c
index 97202cb29adc333869f160819e1d4167f5576ff6..477b6660f447e639a8b181d456c7c4e64e30b008 100644 (file)
@@ -104,6 +104,8 @@ static int sched_create_user(struct user_struct *up)
        if (IS_ERR(up->tg))
                rc = -ENOMEM;
 
+       set_tg_uid(up);
+
        return rc;
 }
 
@@ -239,13 +241,21 @@ static struct kobj_type uids_ktype = {
        .release = uids_release,
 };
 
-/* create /sys/kernel/uids/<uid>/cpu_share file for this user */
+/*
+ * Create /sys/kernel/uids/<uid>/cpu_share file for this user
+ * We do not create this file for users in a user namespace (until
+ * sysfs tagging is implemented).
+ *
+ * See Documentation/scheduler/sched-design-CFS.txt for ramifications.
+ */
 static int uids_user_create(struct user_struct *up)
 {
        struct kobject *kobj = &up->kobj;
        int error;
 
        memset(kobj, 0, sizeof(struct kobject));
+       if (up->user_ns != &init_user_ns)
+               return 0;
        kobj->kset = uids_kset;
        error = kobject_init_and_add(kobj, &uids_ktype, NULL, "%d", up->uid);
        if (error) {
@@ -281,6 +291,8 @@ static void remove_user_sysfs_dir(struct work_struct *w)
        unsigned long flags;
        int remove_user = 0;
 
+       if (up->user_ns != &init_user_ns)
+               return;
        /* Make uid_hash_remove() + sysfs_remove_file() + kobject_del()
         * atomic.
         */