Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=34a1738f7da0b3d28d4b066d03a78f46b8cab68f
Commit:     34a1738f7da0b3d28d4b066d03a78f46b8cab68f
Parent:     6b39c7bfbd1436836c0fb34c5b437fda1a7a3dd4
Author:     Oleg Nesterov <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 04:18:59 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 09:22:26 2008 -0800

    kill my_ptrace_child()
    
    Now that my_ptrace_child() is trivial we can use the "p->ptrace & 
PT_PTRACED"
    inline and simplify the corresponding logic in do_wait: we can't find the
    child in TASK_TRACED state without PT_PTRACED flag set, ptrace_untrace()
    either sets TASK_STOPPED or wakes up the tracee.
    
    Signed-off-by: Oleg Nesterov <[EMAIL PROTECTED]>
    Acked-by: Roland McGrath <[EMAIL PROTECTED]>
    Cc: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/exit.c |   23 +++--------------------
 1 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 1f2c152..b5ff2b1 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1511,12 +1511,6 @@ static int wait_task_continued(struct task_struct *p, 
int noreap,
        return retval;
 }
 
-
-static inline int my_ptrace_child(struct task_struct *p)
-{
-       return p->ptrace & PT_PTRACED;
-}
-
 static long do_wait(pid_t pid, int options, struct siginfo __user *infop,
                    int __user *stat_addr, struct rusage __user *ru)
 {
@@ -1555,22 +1549,11 @@ repeat:
                                /*
                                 * It's stopped now, so it might later
                                 * continue, exit, or stop again.
-                                *
-                                * When we hit the race with PTRACE_ATTACH, we
-                                * will not report this child.  But the race
-                                * means it has not yet been moved to our
-                                * ptrace_children list, so we need to set the
-                                * flag here to avoid a spurious ECHILD when
-                                * the race happens with the only child.
                                 */
                                flag = 1;
-
-                               if (!my_ptrace_child(p)) {
-                                       if (task_is_traced(p))
-                                               continue;
-                                       if (!(options & WUNTRACED))
-                                               continue;
-                               }
+                               if (!(p->ptrace & PT_PTRACED) &&
+                                   !(options & WUNTRACED))
+                                       continue;
 
                                retval = wait_task_stopped(p, ret == 2,
                                                (options & WNOWAIT), infop,
-
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