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");