Skip to content

Commit

Permalink
md/linear: fix hot-add of devices to linear arrays.
Browse files Browse the repository at this point in the history
commit d70ed2e
broke hot-add to a linear array.
After that commit, metadata if not written to devices until they
have been fully integrated into the array as determined by
saved_raid_disk.  That patch arranged to clear that field after
a recovery completed.

However for linear arrays, there is no recovery - the integration is
instantaneous.  So we need to explicitly clear the saved_raid_disk
field.

Signed-off-by: NeilBrown <neilb@suse.de>
  • Loading branch information
neilbrown committed Dec 22, 2011
1 parent 5d8c71f commit 09cd927
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
return -EINVAL;

rdev->raid_disk = rdev->saved_raid_disk;
rdev->saved_raid_disk = -1;

newconf = linear_conf(mddev,mddev->raid_disks+1);

Expand Down

0 comments on commit 09cd927

Please sign in to comment.