diff options
author | Shaohua Li <shli@fb.com> | 2018-10-14 17:05:07 -0700 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2018-10-14 17:05:07 -0700 |
commit | 9e753ba9b9b405e3902d9f08aec5f2ea58a0c317 (patch) | |
tree | e13775c41d767d74ea43520db9d064829f7a133b /drivers/md/raid1.c | |
parent | f8f83d8ffeb47041ff0937ecac6d10bcb388cd9f (diff) | |
download | linux-9e753ba9b9b405e3902d9f08aec5f2ea58a0c317.tar.gz linux-9e753ba9b9b405e3902d9f08aec5f2ea58a0c317.tar.bz2 linux-9e753ba9b9b405e3902d9f08aec5f2ea58a0c317.zip |
MD: fix invalid stored role for a disk - try2
Commit d595567dc4f0 (MD: fix invalid stored role for a disk) broke linear
hotadd. Let's only fix the role for disks in raid1/10.
Based on Guoqing's original patch.
Reported-by: kernel test robot <rong.a.chen@intel.com>
Cc: Gioh Kim <gi-oh.kim@profitbricks.com>
Cc: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 4e990246225e..1d54109071cc 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1734,6 +1734,7 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev) */ if (rdev->saved_raid_disk >= 0 && rdev->saved_raid_disk >= first && + rdev->saved_raid_disk < conf->raid_disks && conf->mirrors[rdev->saved_raid_disk].rdev == NULL) first = last = rdev->saved_raid_disk; |