Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.mixmin.net!feeds.phibee-telecom.net!news.panservice.it!bofh.it!news.nic.it!robomod From: "Levin, Alexander (Sasha Levin)" Newsgroups: linux.kernel Subject: [PATCH review for 4.9 18/50] md/linear: shutup lockdep warnning Date: Mon, 25 Sep 2017 03:40:03 +0200 Message-ID: References: X-Original-To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506302043; x=1537838043; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=UDeyOahJBrIydUiDIbaRfHVnGpfvRLgGDMNus+hfKMg=; b=XABrM4G9kqAWVWanSqVIPq4baxYkXzHKUBGYPCLI49aZmotBXipFDPIL H/gVSF2trwzBYwLm1MAC22FyXBCIDvZfXW/jTdRQEu/ezi6V5478gPSuB MLL6EABMppGO+mp55neSTP9YoN46B4xRDknD86PnLBm0Qi/aFJfRETMyG A=; Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506301975; x=1537837975; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=UDeyOahJBrIydUiDIbaRfHVnGpfvRLgGDMNus+hfKMg=; b=tPyX48934zylHH46N98smOqs+8c2PwdJzsI2BL1g+rD1Ig4l5QNRGQQN l3YeIiF0S9PthdREoGK0bziuonrAlSXw5IQEGUWONWEDe5Y36nB5pSnyn xd2dE4LbS6ZYuIT0B3DTRLtQx5zCaf103fXHcoYhXko10xR4eHu86f40K A=; Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1506301973; x=1537837973; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=UDeyOahJBrIydUiDIbaRfHVnGpfvRLgGDMNus+hfKMg=; b=gifLNhL86KvZVmxAPGNuOWJUHbE/O3zjjs6TB6gx4nc+JEC0koK4TUCG XAEvGmD21VIRiGGMyv3hsYYqB3oFcaAkdMVWJhy/TGmlmVIfzz4N5IYka EwN+IOl6Gz7lgt8p3wkUEnoqIwhnpe5n9zHlHb9m2UQlnZaXD+ZusieOG 8=; X-Host: viking.odc.vzwcorp.com Thread-Topic: [PATCH review for 4.9 18/50] md/linear: shutup lockdep warnning Thread-Index: AQHTNZtlNm/R3GK3fkGE7Ui+Pk6+iA== Accept-Language: en-US Content-Language: en-US X-Ms-Exchange-Messagesentrepresentingtype: 1 X-Ms-Exchange-Transport-Fromentityheader: Hosted X-Originating-IP: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 31 Organization: linux.* mail to news gateway X-Original-Cc: Shaohua Li , "Levin, Alexander (Sasha Levin)" X-Original-Date: Mon, 25 Sep 2017 01:12:46 +0000 X-Original-Message-ID: <20170925011225.10029-18-alexander.levin@verizon.com> X-Original-References: <20170925011225.10029-1-alexander.levin@verizon.com> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1738704 From: Shaohua Li [ Upstream commit d939cdfde34f50b95254b375f498447c82190b3e ] Commit 03a9e24(md linear: fix a race between linear_add() and linear_congested()) introduces the warnning. Acked-by: Coly Li Signed-off-by: Shaohua Li Signed-off-by: Sasha Levin --- drivers/md/linear.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/linear.c b/drivers/md/linear.c index b0c0aef92a37..12abf69d568a 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c @@ -223,7 +223,8 @@ static int linear_add(struct mddev *mddev, struct md_rd= ev *rdev) * oldconf until no one uses it anymore. */ mddev_suspend(mddev); - oldconf =3D rcu_dereference(mddev->private); + oldconf =3D rcu_dereference_protected(mddev->private, + lockdep_is_held(&mddev->reconfig_mutex)); mddev->raid_disks++; WARN_ONCE(mddev->raid_disks !=3D newconf->raid_disks, "copied raid_disks doesn't match mddev->raid_disks"); --=20 2.11.0