aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/linear.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/linear.c')
-rw-r--r--drivers/md/linear.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index fa211d80fc0a..92c64d162a92 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -244,7 +244,9 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
244 if (!newconf) 244 if (!newconf)
245 return -ENOMEM; 245 return -ENOMEM;
246 246
247 oldconf = rcu_dereference(mddev->private); 247 oldconf = rcu_dereference_protected(mddev->private,
248 lockdep_is_held(
249 &mddev->reconfig_mutex));
248 mddev->raid_disks++; 250 mddev->raid_disks++;
249 rcu_assign_pointer(mddev->private, newconf); 251 rcu_assign_pointer(mddev->private, newconf);
250 md_set_array_sectors(mddev, linear_size(mddev, 0, 0)); 252 md_set_array_sectors(mddev, linear_size(mddev, 0, 0));
@@ -256,7 +258,10 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
256 258
257static int linear_stop (struct mddev *mddev) 259static int linear_stop (struct mddev *mddev)
258{ 260{
259 struct linear_conf *conf = mddev->private; 261 struct linear_conf *conf =
262 rcu_dereference_protected(mddev->private,
263 lockdep_is_held(
264 &mddev->reconfig_mutex));
260 265
261 /* 266 /*
262 * We do not require rcu protection here since 267 * We do not require rcu protection here since