revert "proc: fix the threaded proc self"

Revert commit c6caeb7c4544608e8ae62731334661fc396c7f85 ("proc: fix the
threaded /proc/self"), since Eric says "The patch really is wrong.
There is at least one corner case in procps that cares."

Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "Guillaume Chazarain" <guichaz@yahoo.fr>
Cc: "Pavel Emelyanov" <xemul@openvz.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Andrew Morton and committed by Linus Torvalds b55fcb22 0cf975e1

+6 -6
+6 -6
fs/proc/base.c
··· 2102 2102 int buflen) 2103 2103 { 2104 2104 struct pid_namespace *ns = dentry->d_sb->s_fs_info; 2105 - pid_t pid = task_pid_nr_ns(current, ns); 2105 + pid_t tgid = task_tgid_nr_ns(current, ns); 2106 2106 char tmp[PROC_NUMBUF]; 2107 - if (!pid) 2107 + if (!tgid) 2108 2108 return -ENOENT; 2109 - sprintf(tmp, "%d", pid); 2109 + sprintf(tmp, "%d", tgid); 2110 2110 return vfs_readlink(dentry,buffer,buflen,tmp); 2111 2111 } 2112 2112 2113 2113 static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) 2114 2114 { 2115 2115 struct pid_namespace *ns = dentry->d_sb->s_fs_info; 2116 - pid_t pid = task_pid_nr_ns(current, ns); 2116 + pid_t tgid = task_tgid_nr_ns(current, ns); 2117 2117 char tmp[PROC_NUMBUF]; 2118 - if (!pid) 2118 + if (!tgid) 2119 2119 return ERR_PTR(-ENOENT); 2120 - sprintf(tmp, "%d", pid); 2120 + sprintf(tmp, "%d", task_tgid_nr_ns(current, ns)); 2121 2121 return ERR_PTR(vfs_follow_link(nd,tmp)); 2122 2122 } 2123 2123