Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c6caeb7c4544608e8ae62731334661fc396c7f85
Commit:     c6caeb7c4544608e8ae62731334661fc396c7f85
Parent:     488e5bc4560d0b510c1ddc451c51a6cc14e3a930
Author:     Eric W. Biederman <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 04:18:35 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 09:22:24 2008 -0800

    proc: fix the threaded /proc/self
    
    Long ago when the CLONE_THREAD support first went it someone thought it
    would be wise to point /proc/self at /proc/<tgid> instead of /proc/<pid>.
    
    Given that /proc/<tgid> can return information about a very different task
    (if enough things have been unshared) then our current process /proc/<tgid>
    seems blatantly wrong.  So far I have yet to think up an example where the
    current behavior would be advantageous, and I can see several places where
    it is seriously non-intuitive.
    
    We may be stuck with the current broken behavior for backwards
    compatibility reasons but lets try fixing our ancient bug for the 2.6.25
    time frame and see if anyone screams.
    
    Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
    Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: "Guillaume Chazarain" <[EMAIL PROTECTED]>
    Cc: "Pavel Emelyanov" <[EMAIL PROTECTED]>
    Cc: "Rafael J. Wysocki" <[EMAIL PROTECTED]>
    Cc: Oleg Nesterov <[EMAIL PROTECTED]>
    Cc: Roland McGrath <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/proc/base.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 75b1979..de07e95 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2102,22 +2102,22 @@ static int proc_self_readlink(struct dentry *dentry, 
char __user *buffer,
                              int buflen)
 {
        struct pid_namespace *ns = dentry->d_sb->s_fs_info;
-       pid_t tgid = task_tgid_nr_ns(current, ns);
+       pid_t pid = task_pid_nr_ns(current, ns);
        char tmp[PROC_NUMBUF];
-       if (!tgid)
+       if (!pid)
                return -ENOENT;
-       sprintf(tmp, "%d", tgid);
+       sprintf(tmp, "%d", pid);
        return vfs_readlink(dentry,buffer,buflen,tmp);
 }
 
 static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
        struct pid_namespace *ns = dentry->d_sb->s_fs_info;
-       pid_t tgid = task_tgid_nr_ns(current, ns);
+       pid_t pid = task_pid_nr_ns(current, ns);
        char tmp[PROC_NUMBUF];
-       if (!tgid)
+       if (!pid)
                return ERR_PTR(-ENOENT);
-       sprintf(tmp, "%d", task_tgid_nr_ns(current, ns));
+       sprintf(tmp, "%d", pid);
        return ERR_PTR(vfs_follow_link(nd,tmp));
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to