summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2017-02-21 11:57:01 -0800
committerShaohua Li <shli@fb.com>2017-02-23 11:59:42 -0800
commitd939cdfde34f50b95254b375f498447c82190b3e (patch)
treeb6eb446cdfd86ede88f781c60f2d712f04705a83 /drivers/md
parentaf5f42a7e426a87bfa69adc9b9d8930385a1ddf6 (diff)
downloadlinux-d939cdfde34f50b95254b375f498447c82190b3e.tar.bz2
md/linear: shutup lockdep warnning
Commit 03a9e24(md linear: fix a race between linear_add() and linear_congested()) introduces the warnning. Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/linear.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index 789008bc94ff..5b06b0ddf7a3 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -224,7 +224,8 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
* oldconf until no one uses it anymore.
*/
mddev_suspend(mddev);
- oldconf = rcu_dereference(mddev->private);
+ oldconf = rcu_dereference_protected(mddev->private,
+ lockdep_is_held(&mddev->reconfig_mutex));
mddev->raid_disks++;
WARN_ONCE(mddev->raid_disks != newconf->raid_disks,
"copied raid_disks doesn't match mddev->raid_disks");