From 2db863023e82e7b7d93bc9ef336db3c4f15740e9 Mon Sep 17 00:00:00 2001 From: "Labun, Marcin" Date: Thu, 10 Mar 2011 11:50:49 +1100 Subject: [PATCH] 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 --- super-intel.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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", -- 2.39.2