imsm: fix max disks per array

Validate geometry is incorrectly looking at max disks support which is
irrelevant for md/mdadm.  ->dpa (disks per array) is how many disks the
orom will allow per volume.

Also cleanup an unnecessary ->orom check, is_raid_level_supported()
already does the right thing in the !orom case.

Cc: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Dan Williams 2011-08-25 19:14:04 -07:00 committed by NeilBrown
parent 1b17b4e4ff
commit 660260d027
1 changed files with 5 additions and 14 deletions

View File

@ -4933,28 +4933,19 @@ static int imsm_default_chunk(const struct imsm_orom *orom)
}
#define pr_vrb(fmt, arg...) (void) (verbose && fprintf(stderr, Name fmt, ##arg))
/*
* validate volume parameters with OROM/EFI capabilities
*/
static int
validate_geometry_imsm_orom(struct intel_super *super, int level, int layout,
int raiddisks, int *chunk, int verbose)
{
#if DEBUG
verbose = 1;
#endif
/* validate container capabilities */
if (super->orom && raiddisks > super->orom->tds) {
if (verbose)
fprintf(stderr, Name ": %d exceeds maximum number of"
" platform supported disks: %d\n",
raiddisks, super->orom->tds);
/* check/set platform and metadata limits/defaults */
if (super->orom && raiddisks > super->orom->dpa) {
pr_vrb(": platform supports a maximum of %d disks per array\n",
super->orom->dpa);
return 0;
}
/* capabilities of OROM tested - copied from validate_geometry_imsm_volume */
if (super->orom && (!is_raid_level_supported(super->orom, level,
raiddisks))) {
if (!is_raid_level_supported(super->orom, level, raiddisks)) {
pr_vrb(": platform does not support raid%d with %d disk%s\n",
level, raiddisks, raiddisks > 1 ? "s" : "");
return 0;