From 6007b6a4678f5a1c72b1e8a3f354e8e45658bbff Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Tue, 17 Sep 2024 13:28:48 -0400 Subject: [PATCH] device-mapper-multipath-0.9.9-5 Add 0016-multipathd-checker-port_state-before-setting-it.patch Resolves: RHEL-53995 --- ...checker-port_state-before-setting-it.patch | 38 +++++++++++++++++++ device-mapper-multipath.spec | 7 +++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 0016-multipathd-checker-port_state-before-setting-it.patch diff --git a/0016-multipathd-checker-port_state-before-setting-it.patch b/0016-multipathd-checker-port_state-before-setting-it.patch new file mode 100644 index 0000000..32b7397 --- /dev/null +++ b/0016-multipathd-checker-port_state-before-setting-it.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Mon, 16 Sep 2024 19:29:13 -0400 +Subject: [PATCH] multipathd: checker port_state before setting it. + +If the rport port_state is already Marginal, trying to set it to +Marginal causes an error like the following: + +multipathd[365376]: /sys/devices/pci0000:c0/0000:c0:01.1/0000:c4:00.0/host0/rport-0:0-5/fc_remote_ports/rport-0:0-5: failed to set port_state to marginal: Invalid argument + +To avoid causing this confusing error message, check if the port_state +is already marginal before trying to set it. + +Cc: Muneendra Kumar +Signed-off-by: Benjamin Marzinski +--- + multipathd/fpin_handlers.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/multipathd/fpin_handlers.c b/multipathd/fpin_handlers.c +index be087ca0..6b56f9b7 100644 +--- a/multipathd/fpin_handlers.c ++++ b/multipathd/fpin_handlers.c +@@ -169,9 +169,14 @@ fpin_els_add_li_frame(struct fc_nl_event *fc_event) + /*Sets the rport port_state to marginal*/ + static void fpin_set_rport_marginal(struct udev_device *rport_dev) + { ++ char old_value[20]; /* match kernel show_fc_rport_port_state() size */ + static const char marginal[] = "Marginal"; + ssize_t ret; + ++ ret = sysfs_attr_get_value(rport_dev, "port_state", ++ old_value, sizeof(old_value)); ++ if (ret == sizeof(marginal) - 1 && strcmp(old_value, marginal) == 0) ++ return; + ret = sysfs_attr_set_value(rport_dev, "port_state", + marginal, sizeof(marginal) - 1); + if (ret != sizeof(marginal) - 1) diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index f92c5c7..83972bd 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.9.9 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 URL: http://christophe.varoqui.free.fr/ @@ -25,6 +25,7 @@ Patch0012: 0012-RH-add-scsi-device-handlers-to-modules-load.d.patch Patch0013: 0013-RH-compile-with-libreadline-support.patch Patch0014: 0014-RH-Add-mpathcleanup.patch Patch0015: 0015-libmultipath-fix-ontap-prioritizer-snprintf-limits.patch +Patch0016: 0016-multipathd-checker-port_state-before-setting-it.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -234,6 +235,10 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Mon Nov 11 2024 Benjamin Marzinski - 0.9.9-5 +- Add 0016-multipathd-checker-port_state-before-setting-it.patch +- Resolves: RHEL-53995 + * Tue Oct 29 2024 Troy Dawson - 0.9.9-4 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018