X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=kernel%2Fposix-cpu-timers.c;h=657f77697415b2879c07b85e759e8d19b0880b93;hb=30ef36b146be67d6985d5bdaf12d05a39e9a9fb4;hp=7c3e1e6dfb5b5eef84f61f6259e764703846d9fd;hpb=6d03a68e6d5528630955452ec4b768dbde0dc00c;p=linux-2.6-omap-h63xx.git diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index 7c3e1e6dfb5..657f7769741 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c @@ -304,7 +304,7 @@ int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *tp) * should be able to see it. */ struct task_struct *p; - read_lock(&tasklist_lock); + rcu_read_lock(); p = find_task_by_pid(pid); if (p) { if (CPUCLOCK_PERTHREAD(which_clock)) { @@ -312,12 +312,17 @@ int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *tp) error = cpu_clock_sample(which_clock, p, &rtn); } - } else if (p->tgid == pid && p->signal) { - error = cpu_clock_sample_group(which_clock, - p, &rtn); + } else { + read_lock(&tasklist_lock); + if (p->tgid == pid && p->signal) { + error = + cpu_clock_sample_group(which_clock, + p, &rtn); + } + read_unlock(&tasklist_lock); } } - read_unlock(&tasklist_lock); + rcu_read_unlock(); } if (error)