[PATCH 8/9] imsm: FIX: Check correct slots on disk failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---

 super-intel.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 9689fdd..7f9c64f 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)

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux