OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] pid: Extend/Fix pid_vnr
[PATCH] sys_getsid: don't use ->nsproxy directly [message #24607 is a reply to message #24532] Thu, 06 December 2007 17:53 Go to previous message
Oleg Nesterov is currently offline  Oleg Nesterov
Messages: 143
Registered: August 2006
Senior Member
With the new semantics of find_vpid() we don't need to play with ->nsproxy
explicitely, _vxx() do the right things.

Also s/tasklist/rcu/.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- PT/kernel/sys.c~	2007-12-05 21:43:18.000000000 +0300
+++ PT/kernel/sys.c	2007-12-06 20:09:02.000000000 +0300
@@ -1025,19 +1025,16 @@ asmlinkage long sys_getsid(pid_t pid)
 	else {
 		int retval;
 		struct task_struct *p;
-		struct pid_namespace *ns;
 
-		ns = current->nsproxy->pid_ns;
-
-		read_lock(&tasklist_lock);
-		p = find_task_by_pid_ns(pid, ns);
+		rcu_read_lock();
+		p = find_task_by_vpid(pid);
 		retval = -ESRCH;
 		if (p) {
 			retval = security_task_getsid(p);
 			if (!retval)
-				retval = task_session_nr_ns(p, ns);
+				retval = task_session_vnr(p);
 		}
-		read_unlock(&tasklist_lock);
+		rcu_read_unlock();
 		return retval;
 	}
 }

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH][VLAN] Merge tree equal tails in vlan_skb_recv
Next Topic: [PATCH][IPV4] Swap the ifa allocation with the"ipv4_devconf_setall" call
Goto Forum:
  


Current Time: Wed Aug 27 12:16:25 GMT 2025

Total time taken to generate the page: 0.09749 seconds