aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid0.c
diff options
context:
space:
mode:
authorAndre Noll <maan@systemlinux.org>2009-06-17 18:49:23 -0400
committerNeilBrown <neilb@suse.de>2009-06-17 18:49:23 -0400
commit0894cc3066aaa3e75a99383c0d25feebf9b688ac (patch)
tree651664e6b288e36dc9553443e334e650139851c8 /drivers/md/raid0.c
parent8190e754e0723de7cecb80bdd9eb93911dfa04a1 (diff)
md: Move check for bitmap presence to personality code.
If the superblock of a component device indicates the presence of a bitmap but the corresponding raid personality does not support bitmaps (raid0, linear, multipath, faulty), then something is seriously wrong and we'd better refuse to run such an array. Currently, this check is performed while the superblocks are examined, i.e. before entering personality code. Therefore the generic md layer must know which raid levels support bitmaps and which do not. This patch avoids this layer violation without adding identical code to various personalities. This is accomplished by introducing a new public function to md.c, md_check_no_bitmap(), which replaces the hard-coded checks in the superblock loading functions. A call to md_check_no_bitmap() is added to the ->run method of each personality which does not support bitmaps and assembly is aborted if at least one component device contains a bitmap. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r--drivers/md/raid0.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 717e64a4af9a..ab4a489d8695 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -314,6 +314,8 @@ static int raid0_run(mddev_t *mddev)
314 printk(KERN_ERR "md/raid0: chunk size must be set.\n"); 314 printk(KERN_ERR "md/raid0: chunk size must be set.\n");
315 return -EINVAL; 315 return -EINVAL;
316 } 316 }
317 if (md_check_no_bitmap(mddev))
318 return -EINVAL;
317 blk_queue_max_sectors(mddev->queue, mddev->chunk_sectors); 319 blk_queue_max_sectors(mddev->queue, mddev->chunk_sectors);
318 mddev->queue->queue_lock = &mddev->queue->__queue_lock; 320 mddev->queue->queue_lock = &mddev->queue->__queue_lock;
319 321