lkml.org 
[lkml]   [2015]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [EDT][PATCH] kernel/exit.c : Fix missing read_unlock
On 05/21, Maninder Singh wrote:
>
> EP-F6AA0618C49C4AEDA73BFF1B39950BAB
> Hi,
>
> From: Maninder Singh <maninder1.s@samsung.com>
>
> Subject: [PATCH 1/1] kernel/exit.c : Fix missing task_unlock
>
> This patch adds missing read_unlock if do_wait_thread or ptrace_do_wait
> returns non zero.

Confused...

wait_consider_task() should drop tasklist_lock if it returns non-zero?


> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -1486,12 +1486,16 @@ repeat:
> tsk = current;
> do {
> retval = do_wait_thread(wo, tsk);
> - if (retval)
> + if (retval) {
> + read_unlock(&tasklist_lock);
> goto end;
> + }
>
> retval = ptrace_do_wait(wo, tsk);
> - if (retval)
> + if (retval) {
> + read_unlock(&tasklist_lock);
> goto end;
> + }

Well, the patch is obviously wrong. Because, again, tasklist_lock was
already unlocked if (say) wait_task_zombie() reaps a child.

If you think there is a case which forgets to unlock, please tell us
more.

Oleg.



\
 
 \ /
  Last update: 2015-05-21 21:01    [W:0.134 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site