SHA256
1
0
forked from pool/mdadm
mdadm/1003-mdadm-treat-the-Dell-softraid-array-as-local-array.patch
Neil Brown 0a100e5103 Accepting request 841255 from home:colyli:branches:Base:System
- Update to latest mdadm which is requested by jsc#SLE-13700 from
  partners. Mostly the purpose is for latest Intel IMSM raid
  support, while some other fixes are important too.
- imsm: Correct minimal device size (jsc#SLE-13700)
  0073-imsm-Correct-minimal-device-size.patch
- Detail: show correct bitmap info for cluster raid device
  (jsc#SLE-13700)
  0074-Detail-show-correct-bitmap-info-for-cluster-raid-dev.patch
- imsm: support the Array Creation Time field in metadata
  (jsc#SLE-13700)
  0075-imsm-support-the-Array-Creation-Time-field-in-metada.patch
- imsm: show Subarray and Volume ID in --examine output
  (jsc#SLE-13700)
  0076-imsm-show-Subarray-and-Volume-ID-in-examine-output.patch
- udev: Ignore change event for imsm (jsc#SLE-13700)
  0077-udev-Ignore-change-event-for-imsm.patch
- Manage, imsm: Write metadata before add (jsc#SLE-13700)
  0078-Manage-imsm-Write-metadata-before-add.patch
- Assemble: print error message if mdadm fails assembling
  with --uuid option (jsc#SLE-13700)
  0079-Assemble-print-error-message-if-mdadm-fails-assembli.patch
- clean up meaning of small typo (jsc#SLE-13700)
  0080-clean-up-meaning-of-small-typo.patch
- Assemble.c: respect force flag (jsc#SLE-13700)
  0081-Assemble.c-respect-force-flag.patch
- mdcheck: Log when done (jsc#SLE-13700)
  0082-mdcheck-Log-when-done.patch
- Makefile: add EXTRAVERSION support (jsc#SLE-13700)
  0083-Makefile-add-EXTRAVERSION-support.patch
- uuid.c: split uuid stuffs from util.c (jsc#SLE-13700)

OBS-URL: https://build.opensuse.org/request/show/841255
OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=189
2020-10-15 23:45:51 +00:00

60 lines
2.4 KiB
Diff

From 2361620a9d78a4e26ec438b5cc21fe796d411497 Mon Sep 17 00:00:00 2001
From: Coly Li <colyli@suse.de>
Date: Mon, 31 Aug 2020 00:02:10 +0800
Subject: [PATCH] mdadm: treat the Dell softraid array as local array
Patch-mainline: N/A, in-house usage only as a workaround to Dell's softraid bug
References: bsc#1175004
Dell softraid FW uses homehost in md raid superblock to store
its virtual disk name e.g. "VirtualDisk01". The improper usage
of md raid super block meta data from Dell softraid S150 utility
makes mdadm takes such md raid (Dell softraid Virtual Disk) as
foreign array and won't automatically assemble this array by
default. Here if an array's homehost name starts with "VirtualDisk"
then we take it as a Dell software raid and bypass the set_name
checking. This workaround makes current Dell software raid array
can be treated as local array and start automatically.
This workaround patch will be withdrawn after Dell softraid FW
fixes the improper usage problem on md raid superblock.
Signed-off-by: Coly Li <colyli@suse.de>
---
super1.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/super1.c b/super1.c
index 7664883..d15067a 100644
--- a/super1.c
+++ b/super1.c
@@ -954,8 +954,25 @@ static int examine_badblocks_super1(struct supertype *st, int fd, char *devname)
static int match_home1(struct supertype *st, char *homehost)
{
struct mdp_superblock_1 *sb = st->sb;
- int l = homehost ? strlen(homehost) : 0;
+ char *dell_softraid_header = "VirtualDisk";
+ int l = strlen(dell_softraid_header);
+
+ /*
+ * Dell softraid FW uses homehost in md raid superblock to store
+ * its virtual disk name e.g. "VirtualDisk01". The improper usage
+ * of md raid super block meta data from Dell softraid S150 utility
+ * makes mdadm takes such md raid (Dell softraid Virtual Disk) as
+ * foreign array and won't automatically assemble this array by
+ * default. Here if an array's homehost name starts with "VirtualDisk"
+ * then we take it as a Dell software raid and bypass the set_name
+ * checking. This workaround makes current Dell software raid array
+ * can be treated as local array and start automatically.
+ */
+ if (strncmp(sb->set_name, dell_softraid_header, l) == 0)
+ return 1;
+ /* Normal cases handleing */
+ l = homehost ? strlen(homehost) : 0;
return (l > 0 && l < 32 && sb->set_name[l] == ':' &&
strncmp(sb->set_name, homehost, l) == 0);
}
--
2.26.2