Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp498234ybl; Wed, 29 Jan 2020 04:33:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwnSSYH6Pq4ztoIuZSYttnoGjocZkTdsSYOpTSeW8vH6Yyve+OQAWwBrcBTOMcGeT2S4ud4 X-Received: by 2002:aca:f1c6:: with SMTP id p189mr6369050oih.159.1580301191977; Wed, 29 Jan 2020 04:33:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580301191; cv=none; d=google.com; s=arc-20160816; b=tbLoKSc0Prts07g1wsJYqUbbdrJOECegchXIURKSiy4484uVC7OMGxUJhWTmHOGFLm y4amX453wD50LYXVwWBoqw8ErcL2W1CvHA4t9WxFV8nhzPyYWw44Zgl/XW2qXp9+lyk8 FfJNVHxDuLWE5QiMONT1hC6j8DE3+8mJm+NOMVjOF6j5S0B3wdHZHqkBxAETtL7V8fC4 wuR7F6uwvERAR02h7UltK08DOW8j2nrruC1bOIh8LMULPNzdMByCQPR3TcBj0jMJAuZQ fE1sS46P0EoYYcb7fD/PTXNaYVyKViYYTpmGAiZ90/Na6iqqFHcjU2J31JNdjEzzLbKk Hk4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mVoGmnbnu+6R1pSCl0dLyuO7kwDWvlmj5m5kaifObZg=; b=pVkdPfAimlbmQBMq5WSx5SOMq3IqSRT5QwlrCXwsQcEgK8e7Jv6f/cLBkYMzOc1aar QM1ZnLEWLAEEJfPwfKOo8iY1faIJ80TQhoTQT/Lk4MqBgPsn3Ymv7OqIDPFszAhLlc+j PQPPNItZz44zbMnCeLV82SY5sHwtmytMIWHgRhitYuJfSnznrdHOPYlivMyGKemSSNJO eGdn5UviXPrvJmgic05BP954V/N5nGkr+q8EAJomORRJaCaJOZFxPpXNvZX+0LpcyCq1 y9xB+dIdESEhVXYkcFId6d7RMSv+xvj1cUxMx0vXhi8YbzB6YBNRQuU+s37L8U+ix30y /QMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZaaLsCCu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si1104104otq.223.2020.01.29.04.32.58; Wed, 29 Jan 2020 04:33:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZaaLsCCu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726632AbgA2MbA (ORCPT + 99 others); Wed, 29 Jan 2020 07:31:00 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:22035 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726186AbgA2MbA (ORCPT ); Wed, 29 Jan 2020 07:31:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580301059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mVoGmnbnu+6R1pSCl0dLyuO7kwDWvlmj5m5kaifObZg=; b=ZaaLsCCub7Z4xmuXFeLEhSU6vMEN5NwNHeaaEzoCGXSXfKE2yartIajPJEYizEgjx4OzKw 0tHjngx8fOA9hg1hJ6noOcdSHz77jk6jFckJoCfUUHZbt0nQzrLE8hLlsFM1cxtPc/hArq s2b45Xcm+NP7jE1nsGgYBWl4N2I+DT4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-271-Q5wd-9RhPqyzHHEuMF8AeA-1; Wed, 29 Jan 2020 07:30:53 -0500 X-MC-Unique: Q5wd-9RhPqyzHHEuMF8AeA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7238E800D41; Wed, 29 Jan 2020 12:30:51 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.70]) by smtp.corp.redhat.com (Postfix) with SMTP id 8A0695C1B5; Wed, 29 Jan 2020 12:30:49 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 29 Jan 2020 13:30:49 +0100 (CET) Date: Wed, 29 Jan 2020 13:30:47 +0100 From: Oleg Nesterov To: madhuparnabhowmik10@gmail.com Cc: peterz@infradead.org, mingo@kernel.org, christian.brauner@ubuntu.com, paulmck@kernel.org, linux-kernel@vger.kernel.org, joel@joelfernandes.org, linux-kernel-mentees@lists.linuxfoundation.org, rcu@vger.kernel.org Subject: Re: [PATCH] exit.c: Fix Sparse errors and warnings Message-ID: <20200129123046.GA1726@redhat.com> References: <20200128172008.22665-1-madhuparnabhowmik10@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200128172008.22665-1-madhuparnabhowmik10@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/28, madhuparnabhowmik10@gmail.com wrote: > > kernel/exit.c:626:40: warning: incorrect type in assignment > > Signed-off-by: Madhuparna Bhowmik > --- > kernel/exit.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/exit.c b/kernel/exit.c > index bcbd59888e67..c5a9d6360440 100644 > --- a/kernel/exit.c > +++ b/kernel/exit.c > @@ -623,8 +623,8 @@ static void forget_original_parent(struct task_struct *father, > reaper = find_new_reaper(father, reaper); > list_for_each_entry(p, &father->children, sibling) { > for_each_thread(p, t) { > - t->real_parent = reaper; > - BUG_ON((!t->ptrace) != (t->parent == father)); > + rcu_assign_pointer(t->real_parent, reaper); Another case when RCU_INIT_POINTER() makes more sense (although to me it too looks confusing). We didn't modify the new parent. Oleg.