]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/sys.c
[SCSI] hptiop: fix header.context usage
[linux-2.6-omap-h63xx.git] / kernel / sys.c
index c326d6dceee337e41e70d441ac07ff3dabe275c6..a626116af5db96b58f47434eb47c6af23da6535e 100644 (file)
@@ -991,17 +991,14 @@ asmlinkage long sys_getpgid(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);
+               p = find_task_by_vpid(pid);
                retval = -ESRCH;
                if (p) {
                        retval = security_task_getpgid(p);
                        if (!retval)
-                               retval = task_pgrp_nr_ns(p, ns);
+                               retval = task_pgrp_vnr(p);
                }
                read_unlock(&tasklist_lock);
                return retval;
@@ -1025,19 +1022,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;
        }
 }
@@ -1054,14 +1048,10 @@ asmlinkage long sys_setsid(void)
        if (group_leader->signal->leader)
                goto out;
 
-       /* Fail if a process group id already exists that equals the proposed
-        * session id.
-        *
-        * Don't check if session == 1 because kernel threads and CLONE_NEWPID
-        * tasks use this session id and so the check will always fail and make
-        * it so init cannot successfully call setsid.
+       /* Fail if a process group id already exists that equals the
+        * proposed session id.
         */
-       if (session != 1 && pid_task(sid, PIDTYPE_PGID))
+       if (pid_task(sid, PIDTYPE_PGID))
                goto out;
 
        group_leader->signal->leader = 1;