]> bbs.cooldavid.org Git - net-next-2.6.git/commit
md: Move check for bitmap presence to personality code.
authorAndre Noll <maan@systemlinux.org>
Wed, 17 Jun 2009 22:49:23 +0000 (08:49 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 17 Jun 2009 22:49:23 +0000 (08:49 +1000)
commit0894cc3066aaa3e75a99383c0d25feebf9b688ac
tree651664e6b288e36dc9553443e334e650139851c8
parent8190e754e0723de7cecb80bdd9eb93911dfa04a1
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>
drivers/md/faulty.c
drivers/md/linear.c
drivers/md/md.c
drivers/md/md.h
drivers/md/multipath.c
drivers/md/raid0.c