net: Guaranetee the proper ordering of the loopback device.
[safe/jmp/linux-2.6] / include / linux / tracehook.h
index 1253283..6186a78 100644 (file)
@@ -272,7 +272,7 @@ static inline void tracehook_finish_clone(struct task_struct *child,
  * tracehook_report_clone_complete().  This must prevent the child from
  * self-reaping if tracehook_report_clone_complete() uses the @child
  * pointer; otherwise it might have died and been released by the time
- * tracehook_report_report_clone_complete() is called.
+ * tracehook_report_clone_complete() is called.
  *
  * Called with no locks held, but the child cannot run until this returns.
  */
@@ -280,7 +280,7 @@ static inline void tracehook_report_clone(int trace, struct pt_regs *regs,
                                          unsigned long clone_flags,
                                          pid_t pid, struct task_struct *child)
 {
-       if (unlikely(trace)) {
+       if (unlikely(trace) || unlikely(clone_flags & CLONE_PTRACE)) {
                /*
                 * The child starts up with an immediate SIGSTOP.
                 */
@@ -487,6 +487,9 @@ static inline int tracehook_notify_jctl(int notify, int why)
        return notify || (current->ptrace & PT_PTRACED);
 }
 
+#define DEATH_REAP                     -1
+#define DEATH_DELAYED_GROUP_LEADER     -2
+
 /**
  * tracehook_notify_death - task is dead, ready to notify parent
  * @task:              @current task now exiting
@@ -501,8 +504,6 @@ static inline int tracehook_notify_jctl(int notify, int why)
  *
  * Called with write_lock_irq(&tasklist_lock) held.
  */
-#define DEATH_REAP                     -1
-#define DEATH_DELAYED_GROUP_LEADER     -2
 static inline int tracehook_notify_death(struct task_struct *task,
                                         void **death_cookie, int group_dead)
 {