aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-07-27 21:31:47 -0400
committerNeilBrown <neilb@suse.de>2011-07-27 21:31:47 -0400
commit34b343cff4354ab9864be83be88405fd53d928a0 (patch)
tree10d75ecac6091f955cbb8a60b79f443355ca4ea8 /drivers/md/raid1.c
parent6e0d2d0312fb20c1edac1b2c849068c1c7944abf (diff)
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>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 3cbf0ac2aaad..8db311d7cddc 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1055,6 +1055,9 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
1055 if (mddev->recovery_disabled == conf->recovery_disabled) 1055 if (mddev->recovery_disabled == conf->recovery_disabled)
1056 return -EBUSY; 1056 return -EBUSY;
1057 1057
1058 if (rdev->badblocks.count)
1059 return -EINVAL;
1060
1058 if (rdev->raid_disk >= 0) 1061 if (rdev->raid_disk >= 0)
1059 first = last = rdev->raid_disk; 1062 first = last = rdev->raid_disk;
1060 1063
@@ -1994,6 +1997,10 @@ static int run(mddev_t *mddev)
1994 blk_queue_segment_boundary(mddev->queue, 1997 blk_queue_segment_boundary(mddev->queue,
1995 PAGE_CACHE_SIZE - 1); 1998 PAGE_CACHE_SIZE - 1);
1996 } 1999 }
2000 if (rdev->badblocks.count) {
2001 printk(KERN_ERR "md/raid1: Cannot handle bad blocks yet\n");
2002 return -EINVAL;
2003 }
1997 } 2004 }
1998 2005
1999 mddev->degraded = 0; 2006 mddev->degraded = 0;