Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp644665ybl; Tue, 28 Jan 2020 09:22:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwJLUrY8sV/AW2n1ACaUplHsqJdZ+m2bHmUfT72V+cacA2nTK5j02+BHcivbHF0Ud43nW5L X-Received: by 2002:a9d:5888:: with SMTP id x8mr16419962otg.361.1580232150076; Tue, 28 Jan 2020 09:22:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580232150; cv=none; d=google.com; s=arc-20160816; b=nlxSVQSDw2/FzxZfoJ261FDoUQdGatojjfe+WIbDM1DzwF8vey8yBWmgXYTGDg1DXY w29LYy4FWNsmComCkkugWcFur/Q8lKWzwtjHgD+Uq69hNjROHGfejO9lSjo0EMFUiGjQ BGNliwMGPtiwe9ISNtHaWIWrD6WwN3CQBDN65kQwxgpiUn4i+1ZpooETBC7/fDiFo4Xm NrUvQo4em1tFE0q16wC5NS8m+oAQRKEnCDsklP2cHT1Ls0FNO8hEuYlHFcmKXMQgEdPv YAwztR50sS3dUFOYkES+2bosqJb0pdRixK/XkDwQJWcvS7Y77uhvcDsBpPZNcFPgCWd7 I2BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=jf3QvTBtLBXkEUTUJ6dEyaixgm7RPtLRLhyBEDMajRM=; b=HzBKBqKHTprl2LK0RaUWKrIFcGXp43+2YipkCIoa2p5UnqU7b1mQA7h7E2v/+NICRG 8sL+dBwdAS0cSIM/T4phHfXFkBJvhARLbdsQqCYKFCvwTbQ+fDxICmDfHJwphpAwFlDy UIZl3vTy3XgFrnn6Wq6uWG+RkVdOaq26Q+SIaojWp0ykmXFgKqT2pyXCUqHz5lbaBgVj 66MOnpt5pi6bJMBEq6ep7Z15iArGWJI1iNl4fv60ATlxmFSmzowz2rC0z65F8s38/vzq 2IBHw1w3CQP71vG3J4UDXNIYefkxN0VDnnFL6hHQWg5M5+Xvfyi0gWeKNRW6pWy2esgQ hPNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CPLLbufU; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x19si7224523otk.89.2020.01.28.09.22.16; Tue, 28 Jan 2020 09:22:30 -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=@gmail.com header.s=20161025 header.b=CPLLbufU; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726266AbgA1RUS (ORCPT + 99 others); Tue, 28 Jan 2020 12:20:18 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36325 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbgA1RUS (ORCPT ); Tue, 28 Jan 2020 12:20:18 -0500 Received: by mail-pg1-f194.google.com with SMTP id k3so7318278pgc.3; Tue, 28 Jan 2020 09:20:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=jf3QvTBtLBXkEUTUJ6dEyaixgm7RPtLRLhyBEDMajRM=; b=CPLLbufURDm6a2I+e5yqSQa31hPHb6Z6iVXHANzSfE6mwte4IcdDCHSoosA5y38tdR v6SDkrLCTZYuTLqBEIIjkkn0C0ceHnHn3y4ka6znW+EKcqQXl5n5UpHwUzbTilqxmcAz Kn2oh6Q6nbOIAfsu4r6VBt0Dh0nKM7AU7O8ztAHxWZEWSXhoMW+UPnybyI+FMY4pam+Z 2yho40MOQJTkU6xmY+Xk/SezwWKZ8yubPpYr/WoDjeudSjqhPAXli6Tsxx1F0kuN5JOf 1EyHzLtRepzLVujQUWopEYqCDY6Eu6hKM+c4Fe6ZH47XDTFESizWTmG/BFGjTRumYhG5 Kqvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jf3QvTBtLBXkEUTUJ6dEyaixgm7RPtLRLhyBEDMajRM=; b=pBZ7oLRfm/6gr8YN65/U3C/5ewMcdSrABegqDpirBOeccekymRxBswFL0uuhhXQ91Q hpPfToEisC6rhm+0k8f9LcJvAQUX/hzJeabigFbuOFL7dj5FektBBu5ZwKP5UqahgFKZ NkqfyfrgwmUKe1Z0/CuewfGn63YRF/ABNoffdMq8ewywFYtRqf9pQGxVK9uRYBp8gGT7 r1P+xHlTgpqJ+YrhiB1gk2UA/2kgp1wlOb2BpTPL9/qk0UrBQ9mDkXbSJKMt/nWo3uSw qZ4d4an/pCBtTVlY0DpK47ahLRaQ/f54QkWQLiKSUODu7BTGXAvtuGrbB5JlNv0G15RD 5fmQ== X-Gm-Message-State: APjAAAVeiu/Y/DquPxb6YgrY7BPdAqN0SLGxDqYMqkKnYndUQ9qbu5QO NEm36rC+J5hO5+ket9Lt4A== X-Received: by 2002:a65:4b85:: with SMTP id t5mr20864227pgq.404.1580232017665; Tue, 28 Jan 2020 09:20:17 -0800 (PST) Received: from madhuparna-HP-Notebook.nitk.ac.in ([2402:3a80:1ee4:f372:cc5e:c7d9:2a24:390]) by smtp.gmail.com with ESMTPSA id w26sm12959417pfj.119.2020.01.28.09.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 09:20:17 -0800 (PST) From: madhuparnabhowmik10@gmail.com To: peterz@infradead.org, mingo@kernel.org, oleg@redhat.com, christian.brauner@ubuntu.com, paulmck@kernel.org Cc: linux-kernel@vger.kernel.org, joel@joelfernandes.org, linux-kernel-mentees@lists.linuxfoundation.org, rcu@vger.kernel.org, Madhuparna Bhowmik Subject: [PATCH] exit.c: Fix Sparse errors and warnings Date: Tue, 28 Jan 2020 22:50:08 +0530 Message-Id: <20200128172008.22665-1-madhuparnabhowmik10@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Madhuparna Bhowmik This patch fixes the following sparse error: kernel/exit.c:627:25: error: incompatible types in comparison expression caused due to accessing rcu protected pointer without using rcu primitives. And the following warning: 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); + BUG_ON((!t->ptrace) != (rcu_access_pointer(t->parent) == father)); if (likely(!t->ptrace)) t->parent = t->real_parent; if (t->pdeath_signal) -- 2.17.1