summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-05-18 09:58:55 -0700
committerDan Williams <dan.j.williams@intel.com>2009-05-18 09:58:55 -0700
commit81062a36abd28d2354036da398c2e090fa759198 (patch)
treed38be73a3e1fb31730098cc13b780bc0de53a2d9
parent222a7bfd2ea1696f84fa2f98196f5bdd851ac548 (diff)
downloadmdadm-81062a36abd28d2354036da398c2e090fa759198.tar.gz
mdadm-81062a36abd28d2354036da398c2e090fa759198.tar.xz
mdadm-81062a36abd28d2354036da398c2e090fa759198.zip
imsm: fix num_domains
The 'num_domains' field simply identifies the number of mirrors. So it is 2 for a 2-disk raid1 or a 4-disk raid10. The orom does not currently support more than 2 mirrors, but a three disk raid1 for example would increase num_domains to 3. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--super-intel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/super-intel.c b/super-intel.c
index d7383fb..35c43f4 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -2405,13 +2405,16 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
"in a raid1 volume\n");
return 0;
}
+
+ map->raid_level = info->level;
if (info->level == 10) {
map->raid_level = 1;
map->num_domains = info->raid_disks / 2;
- } else {
- map->raid_level = info->level;
+ } else if (info->level == 1)
+ map->num_domains = info->raid_disks;
+ else
map->num_domains = 1;
- }
+
num_data_stripes = info_to_num_data_stripes(info, map->num_domains);
map->num_data_stripes = __cpu_to_le32(num_data_stripes);