Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756131AbbEUSRl (ORCPT ); Thu, 21 May 2015 14:17:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46379 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754253AbbEUSRg (ORCPT ); Thu, 21 May 2015 14:17:36 -0400 Date: Thu, 21 May 2015 20:16:16 +0200 From: Oleg Nesterov To: Maninder Singh Cc: akpm@linux-foundation.org, mhocko@suse.cz, peterz@infradead.org, mingo@kernel.org, riel@redhat.com, ionut.m.alexa@gmail.com, peter@hurleysoftware.com, linux-kernel@vger.kernel.org, "v.narang@samsung.com" , AKHILESH KUMAR Subject: Re: [EDT][PATCH] kernel/exit.c : Fix missing read_unlock Message-ID: <20150521181616.GA18981@redhat.com> References: <670017389.505251432184399737.JavaMail.weblogic@ep2mlwas07b> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <670017389.505251432184399737.JavaMail.weblogic@ep2mlwas07b> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1212 Lines: 49 On 05/21, Maninder Singh wrote: > > EP-F6AA0618C49C4AEDA73BFF1B39950BAB > Hi, > > From: Maninder Singh > > 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/