Skip to content
Commit d595567d authored by Shaohua Li's avatar Shaohua Li
Browse files

MD: fix invalid stored role for a disk

If we change the number of array's device after device is removed from array,
then add the device back to array, we can see that device is added as active
role instead of spare which we expected.

Please see the below link for details:
https://marc.info/?l=linux-raid&m=153736982015076&w=2



This is caused by that we prefer to use device's previous role which is
recorded by saved_raid_disk, but we should respect the new number of
conf->raid_disks since it could be changed after device is removed.

Reported-by: default avatarGioh Kim <gi-oh.kim@profitbricks.com>
Tested-by: default avatarGioh Kim <gi-oh.kim@profitbricks.com>
Acked-by: default avatarGuoqing Jiang <gqjiang@suse.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent ee37d731
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment