[PATCH 08/14] imsm: do not publish OROM/EFI unsupported arrays
am 08.03.2011 16:21:06 von Marcin.LabunFrom 539ad60606fdc8c19b7b7caf6d89b87a7656daaf Mon Sep 17 00:00:00 2001
From: Marcin Labun
Date: Thu, 3 Mar 2011 15:01:53 +0100
Subject: [PATCH 08/14] 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
---
super-intel.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/super-intel.c b/super-intel.c
index 02952a4..e65a46c 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4844,7 +4844,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
+ */
+ int 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",
--
1.6.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html