md: don't allow arrays to contain devices with bad blocks.

As no personality understand bad block lists yet, we must
reject any device that is known to contain bad blocks.
As the personalities get taught, these tests can be removed.

This only applies to raid1/raid5/raid10.
For linear/raid0/multipath/faulty the whole concept of bad blocks
doesn't mean anything so there is no point adding the checks.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
Esse commit está contido em:
NeilBrown
2011-07-28 11:31:47 +10:00
commit 34b343cff4
3 arquivos alterados com 22 adições e 0 exclusões

Ver arquivo

@@ -1055,6 +1055,9 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
if (mddev->recovery_disabled == conf->recovery_disabled)
return -EBUSY;
if (rdev->badblocks.count)
return -EINVAL;
if (rdev->raid_disk >= 0)
first = last = rdev->raid_disk;
@@ -1994,6 +1997,10 @@ static int run(mddev_t *mddev)
blk_queue_segment_boundary(mddev->queue,
PAGE_CACHE_SIZE - 1);
}
if (rdev->badblocks.count) {
printk(KERN_ERR "md/raid1: Cannot handle bad blocks yet\n");
return -EINVAL;
}
}
mddev->degraded = 0;