linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] imsm: Set disk slot number
@ 2017-10-03 12:49 Mariusz Tkaczyk
  2017-10-03 18:28 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Mariusz Tkaczyk @ 2017-10-03 12:49 UTC (permalink / raw)
  To: jes.sorensen; +Cc: linux-raid, Mariusz Tkaczyk

If first disk of IMSM RAID1 is failed but still present in the system,
the array is not auto-assembled. Auto-assemble uses raid disk slot from
metadata to index disks. As it's not set, the valid disk is seen as a
replacement disk and its metadata is ignored. The problem is not
observed for other RAID levels as they have more than 2 disks -
replacement disks are only stored under uneven indexes so third disk
metadata is used in such scenario.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Reviewed-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
---
 super-intel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/super-intel.c b/super-intel.c
index 536cb61..b561fe2 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -3502,6 +3502,9 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info, char *
 			__u32 ord = get_imsm_ord_tbl_ent(dev, j, MAP_0);
 			__u32 idx = ord_to_idx(ord);
 
+			if (super->disks && super->disks->index == (int)idx)
+				info->disk.raid_disk = j;
+
 			if (!(ord & IMSM_ORD_REBUILD) &&
 			    get_imsm_missing(super, idx)) {
 				missing = 1;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] imsm: Set disk slot number
  2017-10-03 12:49 [PATCH] imsm: Set disk slot number Mariusz Tkaczyk
@ 2017-10-03 18:28 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2017-10-03 18:28 UTC (permalink / raw)
  To: Mariusz Tkaczyk; +Cc: linux-raid

On 10/03/2017 08:49 AM, Mariusz Tkaczyk wrote:
> If first disk of IMSM RAID1 is failed but still present in the system,
> the array is not auto-assembled. Auto-assemble uses raid disk slot from
> metadata to index disks. As it's not set, the valid disk is seen as a
> replacement disk and its metadata is ignored. The problem is not
> observed for other RAID levels as they have more than 2 disks -
> replacement disks are only stored under uneven indexes so third disk
> metadata is used in such scenario.
> 
> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
> Reviewed-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
> ---
>   super-intel.c | 3 +++
>   1 file changed, 3 insertions(+)

Applied!

Thanks,
Jes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-03 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-03 12:49 [PATCH] imsm: Set disk slot number Mariusz Tkaczyk
2017-10-03 18:28 ` Jes Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).