import device-mapper-multipath-0.8.4-23.el8

This commit is contained in:
CentOS Sources 2022-05-14 12:11:09 +00:00 committed by Stepan Oksanichenko
parent 0b595bc701
commit 4bfd7a932a
4 changed files with 150 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xose Vazquez Perez <xose.vazquez@gmail.com>
Date: Wed, 9 Sep 2020 17:48:05 +0200
Subject: [PATCH] multipath-tools: add HPE MSA 1060/2060 to hwtable
Cc: Martin Wilck <mwilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM-DEVEL ML <dm-devel@redhat.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/hwtable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index d680bdfc..59bc0d6e 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -181,9 +181,9 @@ static struct hwentry default_hw[] = {
.prio_name = PRIO_ALUA,
},
{
- /* MSA 1040, 1050, 2040 and 2050 families */
+ /* MSA 1040, 1050, 1060, 2040, 2050 and 2060 families */
.vendor = "HP",
- .product = "MSA [12]0[45]0 SA[NS]",
+ .product = "MSA [12]0[456]0 SA[NS]",
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.no_path_retry = 18,

View File

@ -0,0 +1,78 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Uday Shankar <ushankar@purestorage.com>
Date: Wed, 9 Mar 2022 13:03:26 -0700
Subject: [PATCH] multipath-tools: update mpp->force_readonly in ev_add_path
When NVMe disks are added to the system, no uevent containing the
DISK_RO property is generated. As a result, dm-* nodes backed by
readonly NVMe disks will not have their RO state set properly. The
result looks like this:
$ multipath -l
eui.00c92c091fd6564424a9376600011bd1 dm-3 NVME,Pure Storage FlashArray
size=1.0T features='0' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| `- 0:2:2:72657 nvme0n2 259:4 active undef running
`-+- policy='service-time 0' prio=0 status=enabled
`- 1:0:2:72657 nvme1n2 259:1 active undef running
$ cat /sys/block/dm-3/ro
0
$ cat /sys/block/nvme*n2/ro
1
1
This is not a problem for SCSI disks, since the kernel will emit change
uevents containing the DISK_RO property when the disk is added to the
system. See the following thread for my initial attempt to fix this
issue at the kernel level:
https://lore.kernel.org/linux-block/Yib8GqCA5e3SQYty@infradead.org/T/#t
Fix the issue by picking up the path ro state from sysfs in ev_add_path,
setting the mpp->force_readonly accordingly, and changing
dm_addmap_create to be aware of mpp->force_readonly.
Signed-off-by: Uday Shankar <ushankar@purestorage.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/devmapper.c | 2 +-
multipathd/main.c | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index 3f70e576..e3c3c119 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -420,7 +420,7 @@ int dm_addmap_create (struct multipath *mpp, char * params)
int ro;
uint16_t udev_flags = build_udev_flags(mpp, 0);
- for (ro = 0; ro <= 1; ro++) {
+ for (ro = mpp->force_readonly ? 1 : 0; ro <= 1; ro++) {
int err;
if (dm_addmap(DM_DEVICE_CREATE, TGT_MPATH, mpp, params, ro,
diff --git a/multipathd/main.c b/multipathd/main.c
index f4b79882..eeded52b 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -988,6 +988,7 @@ ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map)
int retries = 3;
int start_waiter = 0;
int ret;
+ int ro;
/*
* need path UID to go any further
@@ -1051,6 +1052,11 @@ rescan:
/* persistent reservation check*/
mpath_pr_event_handle(pp);
+ /* ro check - if new path is ro, force map to be ro as well */
+ ro = sysfs_get_ro(pp);
+ if (ro == 1)
+ mpp->force_readonly = 1;
+
if (!need_do_map)
return 0;

View File

@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Fri, 29 Apr 2022 15:57:12 -0500
Subject: [PATCH] updated HPE MSA builtin config
Make the config better align to MSA 4th, 5th and 6th Generation systems.
Cc: Jon.Paul@hpe.com
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/hwtable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c
index 59bc0d6e..d6325864 100644
--- a/libmultipath/hwtable.c
+++ b/libmultipath/hwtable.c
@@ -182,8 +182,8 @@ static struct hwentry default_hw[] = {
},
{
/* MSA 1040, 1050, 1060, 2040, 2050 and 2060 families */
- .vendor = "HP",
- .product = "MSA [12]0[456]0 SA[NS]",
+ .vendor = "(HP|HPE)",
+ .product = "MSA [12]0[456]0 (SAN|SAS|FC|iSCSI)",
.pgpolicy = GROUP_BY_PRIO,
.pgfailback = -FAILBACK_IMMEDIATE,
.no_path_retry = 18,

View File

@ -1,7 +1,7 @@
Summary: Tools to manage multipath devices using device-mapper
Name: device-mapper-multipath
Version: 0.8.4
Release: 22%{?dist}
Release: 23%{?dist}
License: GPLv2
Group: System Environment/Base
URL: http://christophe.varoqui.free.fr/
@ -101,6 +101,9 @@ Patch00087: 0087-multipathd-avoid-unnecessary-path-read-only-reloads.patch
Patch00088: 0088-libmultipath-make-helper-function-to-trigger-path-ue.patch
Patch00089: 0089-multipathd-trigger-udev-change-on-path-addition.patch
Patch00090: 0090-RH-add-support-to-mpathconf-for-setting-arbitrary-de.patch
Patch00091: 0091-multipath-tools-add-HPE-MSA-1060-2060-to-hwtable.patch
Patch00092: 0092-multipath-tools-update-mpp-force_readonly-in-ev_add_.patch
Patch00093: 0093-updated-HPE-MSA-builtin-config.patch
# runtime
Requires: %{name}-libs = %{version}-%{release}
@ -302,6 +305,15 @@ fi
%{_pkgconfdir}/libdmmp.pc
%changelog
* Tue May 10 2022 Benjamin Marzinski <bmarzins@redhat.com> 0.8.4-23
- Add 0091-multipath-tools-add-HPE-MSA-1060-2060-to-hwtable.patch
* Partial fix for bz #2058222
- Add 0092-multipath-tools-update-mpp-force_readonly-in-ev_add_.patch
* Fixes bz #2065468
- Add 0093-updated-HPE-MSA-builtin-config.patch
* Fixes bz #2058222
- Resolves bz #2065468, #2058222
* Mon Feb 7 2022 Benjamin Marzinski <bmarzins@redhat.com> 0.8.4-22
- Add 0090-RH-add-support-to-mpathconf-for-setting-arbitrary-de.patch
- Resolves: bz #1981240