dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/imsm-Set-disk-slot-number.patch

b7f731
commit 20dc76d15b40c17b4ccdc3d6283af8ecb513707f
b7f731
Author: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
b7f731
Date:   Tue Oct 3 14:49:49 2017 +0200
b7f731
b7f731
    imsm: Set disk slot number
b7f731
    
b7f731
    If first disk of IMSM RAID1 is failed but still present in the system,
b7f731
    the array is not auto-assembled. Auto-assemble uses raid disk slot from
b7f731
    metadata to index disks. As it's not set, the valid disk is seen as a
b7f731
    replacement disk and its metadata is ignored. The problem is not
b7f731
    observed for other RAID levels as they have more than 2 disks -
b7f731
    replacement disks are only stored under uneven indexes so third disk
b7f731
    metadata is used in such scenario.
b7f731
    
b7f731
    Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
b7f731
    Reviewed-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
b7f731
    Signed-off-by: Jes Sorensen <jsorensen@fb.com>
b7f731
b7f731
diff --git a/super-intel.c b/super-intel.c
b7f731
index 536cb61..b561fe2 100644
b7f731
--- a/super-intel.c
b7f731
+++ b/super-intel.c
b7f731
@@ -3502,6 +3502,9 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info, char *
b7f731
 			__u32 ord = get_imsm_ord_tbl_ent(dev, j, MAP_0);
b7f731
 			__u32 idx = ord_to_idx(ord);
b7f731
 
b7f731
+			if (super->disks && super->disks->index == (int)idx)
b7f731
+				info->disk.raid_disk = j;
b7f731
+
b7f731
 			if (!(ord & IMSM_ORD_REBUILD) &&
b7f731
 			    get_imsm_missing(super, idx)) {
b7f731
 				missing = 1;