diff options
author | Oleg Nesterov <oleg@redhat.com> | 2010-05-26 17:43:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:46 -0400 |
commit | ffdf91856c812646aa276711fa7e3ad80b00764a (patch) | |
tree | 0a6d0e6e1edb78aee411c3fb302c43acf34dc7d6 /arch/ia64/kernel | |
parent | d30fda355188272430d3865db2ff9e24b4135ae3 (diff) |
ia64: ptrace_attach_sync_user_rbs: avoid "task->signal != NULL" checks
Preparation to make task->signal immutable, no functional changes.
It doesn't matter which pointer we check under tasklist to ensure the task
was not released, ->signal or ->sighand. But we are going to make
->signal refcountable, change the code to use ->sighand.
Note: this code doesn't need this check and tasklist_lock at all, it
should be converted to use lock_task_sighand(). And, the code under
SIGNAL_STOP_STOPPED check looks wrong.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/ptrace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c index 0dec7f702448..7c7909f9bc93 100644 --- a/arch/ia64/kernel/ptrace.c +++ b/arch/ia64/kernel/ptrace.c | |||
@@ -638,7 +638,7 @@ ptrace_attach_sync_user_rbs (struct task_struct *child) | |||
638 | */ | 638 | */ |
639 | 639 | ||
640 | read_lock(&tasklist_lock); | 640 | read_lock(&tasklist_lock); |
641 | if (child->signal) { | 641 | if (child->sighand) { |
642 | spin_lock_irq(&child->sighand->siglock); | 642 | spin_lock_irq(&child->sighand->siglock); |
643 | if (child->state == TASK_STOPPED && | 643 | if (child->state == TASK_STOPPED && |
644 | !test_and_set_tsk_thread_flag(child, TIF_RESTORE_RSE)) { | 644 | !test_and_set_tsk_thread_flag(child, TIF_RESTORE_RSE)) { |
@@ -662,7 +662,7 @@ ptrace_attach_sync_user_rbs (struct task_struct *child) | |||
662 | * job control stop, so that SIGCONT can be used to wake it up. | 662 | * job control stop, so that SIGCONT can be used to wake it up. |
663 | */ | 663 | */ |
664 | read_lock(&tasklist_lock); | 664 | read_lock(&tasklist_lock); |
665 | if (child->signal) { | 665 | if (child->sighand) { |
666 | spin_lock_irq(&child->sighand->siglock); | 666 | spin_lock_irq(&child->sighand->siglock); |
667 | if (child->state == TASK_TRACED && | 667 | if (child->state == TASK_TRACED && |
668 | (child->signal->flags & SIGNAL_STOP_STOPPED)) { | 668 | (child->signal->flags & SIGNAL_STOP_STOPPED)) { |