[PATCH 6/6] user_namespace: move put_user_ns outside lock

Serge Hallyn serue at us.ibm.com
Fri Jul 25 12:24:32 PDT 2008


Since put_user_ns calls free_user on the creator, we shouldn't
call it from inside the lock in free_user.

Signed-off-by: Serge Hallyn <serue at us.ibm.com>
---
 kernel/user.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/user.c b/kernel/user.c
index 034dae5..d3dd353 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -323,11 +323,11 @@ done:
  */
 static inline void free_user(struct user_struct *up, unsigned long flags)
 {
-	put_user_ns(up->user_ns);
 	/* restore back the count */
 	atomic_inc(&up->__count);
 	spin_unlock_irqrestore(&uidhash_lock, flags);
 
+	put_user_ns(up->user_ns);
 	INIT_WORK(&up->work, remove_user_sysfs_dir);
 	schedule_work(&up->work);
 }
-- 
1.5.4.3



More information about the Containers mailing list