diff options
author | Adam Kwolek <adam.kwolek@intel.com> | 2011-12-07 13:58:38 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-12-08 14:08:21 +1100 |
commit | 0a108d63d2dba518b4d8a5ced91fdbbb5230ca59 (patch) | |
tree | ca29a46f29ee4e214154931e0e15b0674669801f /super-intel.c | |
parent | 3d59f0c039281d0b393d11f6eb8b4ce6bcdbc236 (diff) |
imsm: FIX: Check correct slots on disk failure
When changes are made to 2nd map, slot in second map should be tested
instead first one /as change will be applied to second map).
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/super-intel.c b/super-intel.c index 9689fdd4..7f9c64fb 100644 --- a/super-intel.c +++ b/super-intel.c @@ -4522,14 +4522,16 @@ static int add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk, set_imsm_ord_tbl_ent(map, slot, df->index | IMSM_ORD_REBUILD); if (is_gen_migration(dev)) { struct imsm_map *map2 = get_imsm_map(dev, 1); - if (slot < map2->num_members) { + int slot2 = get_imsm_disk_slot(map2, df->index); + if ((slot2 < map2->num_members) && + (slot2 >= 0)) { __u32 ord2 = get_imsm_ord_tbl_ent(dev, - slot, + slot2, 1); if ((unsigned)df->index == ord_to_idx(ord2)) set_imsm_ord_tbl_ent(map2, - slot, + slot2, df->index | IMSM_ORD_REBUILD); } @@ -6164,8 +6166,11 @@ static int mark_failure(struct imsm_dev *dev, struct imsm_disk *disk, int idx) */ if (dev->vol.migr_state) { struct imsm_map *map2 = get_imsm_map(dev, 1); - if (slot < map2->num_members) - set_imsm_ord_tbl_ent(map2, slot, + int slot2 = get_imsm_disk_slot(map2, idx); + + if ((slot2 < map2->num_members) && + (slot2 >= 0)) + set_imsm_ord_tbl_ent(map2, slot2, idx | IMSM_ORD_REBUILD); } if (map->failed_disk_num == 0xff) |