diff options
author | Andre Noll <maan@systemlinux.org> | 2009-06-17 18:49:23 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-06-17 18:49:23 -0400 |
commit | 0894cc3066aaa3e75a99383c0d25feebf9b688ac (patch) | |
tree | 651664e6b288e36dc9553443e334e650139851c8 /drivers/md/md.h | |
parent | 8190e754e0723de7cecb80bdd9eb93911dfa04a1 (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/md.h')
-rw-r--r-- | drivers/md/md.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index ea2c441449d4..9430a110db93 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
@@ -430,5 +430,6 @@ extern void md_new_event(mddev_t *mddev); | |||
430 | extern int md_allow_write(mddev_t *mddev); | 430 | extern int md_allow_write(mddev_t *mddev); |
431 | extern void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev); | 431 | extern void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev); |
432 | extern void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors); | 432 | extern void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors); |
433 | extern int md_check_no_bitmap(mddev_t *mddev); | ||
433 | 434 | ||
434 | #endif /* _MD_MD_H */ | 435 | #endif /* _MD_MD_H */ |