Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132179
b: refs/heads/master
c: be50b83
h: refs/heads/master
i:
  132177: 5fb89f8
  132175: 8c148ba
v: v3
  • Loading branch information
Dhaval Giani authored and Linus Torvalds committed Mar 10, 2009
1 parent c35445a commit cb5bef8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d58ab5cf09679d8cb4824e22cae900c0eab5ab31
refs/heads/master: be50b8342dead8cacf57d4839240106b225d31f5
14 changes: 7 additions & 7 deletions trunk/kernel/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,12 @@ int __init uids_sysfs_init(void)
/* work function to remove sysfs directory for a user and free up
* corresponding structures.
*/
static void remove_user_sysfs_dir(struct work_struct *w)
static void cleanup_user_struct(struct work_struct *w)
{
struct user_struct *up = container_of(w, struct user_struct, work);
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.
*/
Expand All @@ -312,9 +310,11 @@ static void remove_user_sysfs_dir(struct work_struct *w)
if (!remove_user)
goto done;

kobject_uevent(&up->kobj, KOBJ_REMOVE);
kobject_del(&up->kobj);
kobject_put(&up->kobj);
if (up->user_ns == &init_user_ns) {
kobject_uevent(&up->kobj, KOBJ_REMOVE);
kobject_del(&up->kobj);
kobject_put(&up->kobj);
}

sched_destroy_user(up);
key_put(up->uid_keyring);
Expand All @@ -335,7 +335,7 @@ static void free_user(struct user_struct *up, unsigned long flags)
atomic_inc(&up->__count);
spin_unlock_irqrestore(&uidhash_lock, flags);

INIT_WORK(&up->work, remove_user_sysfs_dir);
INIT_WORK(&up->work, cleanup_user_struct);
schedule_work(&up->work);
}

Expand Down

0 comments on commit cb5bef8

Please sign in to comment.