summaryrefslogtreecommitdiff
path: root/super-intel.c
diff options
context:
space:
mode:
authorLabun, Marcin <Marcin.Labun@intel.com>2011-03-10 11:50:49 +1100
committerNeilBrown <neilb@suse.de>2011-03-10 11:50:49 +1100
commit2db863023e82e7b7d93bc9ef336db3c4f15740e9 (patch)
treeda3e95b69a5c9986ae95091433e8845d85fc9a6d /super-intel.c
parenta891a3c24d0d577acd9c5d0f8dfd27ee13537dac (diff)
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 <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c16
1 files changed, 15 insertions, 1 deletions
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",