if (!newconf)
return -ENOMEM;
- oldconf = rcu_dereference(mddev->private);
+ oldconf = rcu_dereference_protected(mddev->private,
+ lockdep_is_held(
+ &mddev->reconfig_mutex));
mddev->raid_disks++;
rcu_assign_pointer(mddev->private, newconf);
md_set_array_sectors(mddev, linear_size(mddev, 0, 0));
static int linear_stop (struct mddev *mddev)
{
- struct linear_conf *conf = mddev->private;
+ struct linear_conf *conf =
+ rcu_dereference_protected(mddev->private,
+ lockdep_is_held(
+ &mddev->reconfig_mutex));
/*
* We do not require rcu protection here since