diff options
author | Song Liu <songliubraving@fb.com> | 2015-09-03 23:00:35 -0700 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-11-01 13:48:27 +1100 |
commit | 0b020e85bdd5765aac2440848e7a927069f5f83c (patch) | |
tree | 7e8801049e7b6de1ccdc6e280402ee666d74400b /drivers/md | |
parent | 253f9fd41afe2492b85de779946b5882a00dcdc5 (diff) | |
download | linux-0b020e85bdd5765aac2440848e7a927069f5f83c.tar.gz linux-0b020e85bdd5765aac2440848e7a927069f5f83c.tar.bz2 linux-0b020e85bdd5765aac2440848e7a927069f5f83c.zip |
skip match_mddev_units check for special roles
match_mddev_units is used to check whether 2 RAID arrays share
same disk(s). Arrays that share disk(s) will not do resync at the
same time for better performance (fewer HDD seek). However, this
check should not apply to Spare, Faulty, and Journal disks, as
they do not paticipate in resync.
In this patch, match_mddev_units skips check for disks with flag
"Faulty" or "Journal" or raid_disk < 0.
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 89149acd8a5e..fe67272d0b1b 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -1935,13 +1935,23 @@ static int match_mddev_units(struct mddev *mddev1, struct mddev *mddev2) struct md_rdev *rdev, *rdev2; rcu_read_lock(); - rdev_for_each_rcu(rdev, mddev1) - rdev_for_each_rcu(rdev2, mddev2) + rdev_for_each_rcu(rdev, mddev1) { + if (test_bit(Faulty, &rdev->flags) || + test_bit(Journal, &rdev->flags) || + rdev->raid_disk == -1) + continue; + rdev_for_each_rcu(rdev2, mddev2) { + if (test_bit(Faulty, &rdev2->flags) || + test_bit(Journal, &rdev2->flags) || + rdev2->raid_disk == -1) + continue; if (rdev->bdev->bd_contains == rdev2->bdev->bd_contains) { rcu_read_unlock(); return 1; } + } + } rcu_read_unlock(); return 0; } |