From: Labun, Marcin Date: Thu, 10 Mar 2011 00:50:49 +0000 (+1100) Subject: imsm: do not publish OROM/EFI unsupported arrays X-Git-Tag: mdadm-3.2.1~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2db863023e82e7b7d93bc9ef336db3c4f15740e9;p=thirdparty%2Fmdadm.git imsm: do not publish OROM/EFI unsupported arrays Container_content_imsm calls validate_goemtry_imsm_orom to verify that the array parameters are supported by controller's OROM/EFI. Signed-off-by: Marcin Labun Signed-off-by: NeilBrown --- diff --git a/super-intel.c b/super-intel.c index 200112de..7f620c06 100644 --- a/super-intel.c +++ b/super-intel.c @@ -4824,7 +4824,7 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra struct imsm_map *map; struct imsm_map *map2; struct mdinfo *this; - int slot; + int slot, chunk; char *ep; if (subarray && @@ -4845,7 +4845,21 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra dev->volume); continue; } + /* do not publish arrays that are not support by controller's + * OROM/EFI + */ + chunk = __le16_to_cpu(map->blocks_per_strip) >> 1; + if (!validate_geometry_imsm_orom(super, + get_imsm_raid_level(map), /* RAID level */ + imsm_level_to_layout(get_imsm_raid_level(map)), + map->num_members, /* raid disks */ + &chunk, + 1 /* verbose */)) { + fprintf(stderr, Name ": RAID gemetry validation failed. " + "Cannot proceed with the action(s).\n"); + continue; + } this = malloc(sizeof(*this)); if (!this) { fprintf(stderr, Name ": failed to allocate %zu bytes\n",