This check is not needed for correctness and racy anyway. I also
slow downs the likely case.

Signed-off-by: Oleg Nesterov <o...@redhat.com>
---

 kernel/utrace.c |   15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

--- __UTRACE/kernel/utrace.c~1_ATTACH_DONT_CK_DEAD      2009-09-08 
18:15:38.000000000 +0200
+++ __UTRACE/kernel/utrace.c    2009-09-08 20:48:56.000000000 +0200
@@ -210,23 +210,10 @@ struct utrace_engine *utrace_attach_task
        struct task_struct *target, int flags,
        const struct utrace_engine_ops *ops, void *data)
 {
-       struct utrace *utrace;
+       struct utrace *utrace = task_utrace_struct(target);
        struct utrace_engine *engine;
        int ret;
 
-       utrace = &target->utrace;
-
-       if (unlikely(target->exit_state == EXIT_DEAD)) {
-               /*
-                * The target has already been reaped.
-                * Check this early, though it's not synchronized.
-                * utrace_add_engine() will do the final check.
-                */
-               if (!(flags & UTRACE_ATTACH_CREATE))
-                       return ERR_PTR(-ENOENT);
-               return ERR_PTR(-ESRCH);
-       }
-
        if (!(flags & UTRACE_ATTACH_CREATE)) {
                spin_lock(&utrace->lock);
                engine = matching_engine(utrace, flags, ops, data);

Reply via email to