Commit 61a27e1f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

md: compare bd_disk instead of bd_contains

To check for partitions of the same disk bd_contains works as well, but
bd_disk is way more obvious.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarSong Liu <song@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent fa01b1e9
...@@ -2322,8 +2322,7 @@ static int match_mddev_units(struct mddev *mddev1, struct mddev *mddev2) ...@@ -2322,8 +2322,7 @@ static int match_mddev_units(struct mddev *mddev1, struct mddev *mddev2)
test_bit(Journal, &rdev2->flags) || test_bit(Journal, &rdev2->flags) ||
rdev2->raid_disk == -1) rdev2->raid_disk == -1)
continue; continue;
if (rdev->bdev->bd_contains == if (rdev->bdev->bd_disk == rdev2->bdev->bd_disk) {
rdev2->bdev->bd_contains) {
rcu_read_unlock(); rcu_read_unlock();
return 1; return 1;
} }
...@@ -5944,8 +5943,8 @@ int md_run(struct mddev *mddev) ...@@ -5944,8 +5943,8 @@ int md_run(struct mddev *mddev)
rdev_for_each(rdev, mddev) rdev_for_each(rdev, mddev)
rdev_for_each(rdev2, mddev) { rdev_for_each(rdev2, mddev) {
if (rdev < rdev2 && if (rdev < rdev2 &&
rdev->bdev->bd_contains == rdev->bdev->bd_disk ==
rdev2->bdev->bd_contains) { rdev2->bdev->bd_disk) {
pr_warn("%s: WARNING: %s appears to be on the same physical disk as %s.\n", pr_warn("%s: WARNING: %s appears to be on the same physical disk as %s.\n",
mdname(mddev), mdname(mddev),
bdevname(rdev->bdev,b), bdevname(rdev->bdev,b),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment