- fence_scsi: preempt clears all devices on the mpath device,

so only run it for the first device
This commit is contained in:
eabdullin 2024-11-12 17:02:18 +03:00
parent 3ff5848efb
commit 3e7b877292
2 changed files with 50 additions and 3 deletions

View File

@ -0,0 +1,40 @@
From cb57f1c2ee734a40d01249305965ea4ecdf02039 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Thu, 5 Sep 2024 09:06:34 +0200
Subject: [PATCH] fence_scsi: preempt clears all devices on the mpath device,
so only run it for the first device
---
agents/scsi/fence_scsi.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/agents/scsi/fence_scsi.py b/agents/scsi/fence_scsi.py
index a1598411c..12f7fb49b 100644
--- a/agents/scsi/fence_scsi.py
+++ b/agents/scsi/fence_scsi.py
@@ -131,11 +131,13 @@ def reset_dev(options, dev):
return run_cmd(options, options["--sg_turs-path"] + " " + dev)["rc"]
-def register_dev(options, dev, key):
+def register_dev(options, dev, key, do_preempt=True):
dev = os.path.realpath(dev)
if re.search(r"^dm", dev[5:]):
- for slave in get_mpath_slaves(dev):
- register_dev(options, slave, key)
+ devices = get_mpath_slaves(dev)
+ register_dev(options, devices[0], key)
+ for device in devices[1:]:
+ register_dev(options, device, key, False)
return True
# Check if any registration exists for the key already. We track this in
@@ -153,7 +155,7 @@ def register_dev(options, dev, key):
# If key matches, make sure it matches with the connection that
# exists right now. To do this, we can issue a preempt with same key
# which should replace the old invalid entries from the target.
- if not preempt(options, key, dev, key):
+ if do_preempt and not preempt(options, key, dev, key):
return False
# If there was no reservation, we need to issue another registration

View File

@ -57,7 +57,7 @@
Name: fence-agents
Summary: Set of unified programs capable of host isolation ("fencing")
Version: 4.10.0
Release: 76%{?alphatag:.%{alphatag}}%{?dist}
Release: 76%{?alphatag:.%{alphatag}}%{?dist}.1.alma.1
License: GPLv2+ and LGPLv2+
URL: https://github.com/ClusterLabs/fence-agents
Source0: https://fedorahosted.org/releases/f/e/fence-agents/%{name}-%{version}.tar.gz
@ -255,6 +255,10 @@ Patch55: RHEL-25256-fence_vmware_rest-detect-user-sufficient-rights.patch
Patch56: RHEL-43235-fence_aws-1-list-add-instance-name-status.patch
Patch57: RHEL-43235-fence_aws-2-log-error-for-unknown-states.patch
# Patches were taken from:
# https://gitlab.com/redhat/centos-stream/rpms/fence-agents/-/commit/be11154c5e0fdad22e1b4fbcd6e2f9a05c4bbd33
Patch58: RHEL-59878-fence_scsi-only-preempt-once-for-mpath-devices.patch
### HA support libs/utils ###
# all archs
Patch1000: bz2217902-1-kubevirt-fix-bundled-dateutil-CVE-2007-4559.patch
@ -433,6 +437,7 @@ BuildRequires: %{systemd_units}
%patch -p1 -P 55
%patch -p1 -P 56
%patch -p1 -P 57
%patch -p1 -P 58
# prevent compilation of something that won't get used anyway
sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac
@ -1530,6 +1535,10 @@ are located on corosync cluster nodes.
%endif
%changelog
* Tue Nov 12 2024 Eduard Abdullin <eabdullin@almalinux.org> - 4.10.0-76.1.alma.1
- fence_scsi: preempt clears all devices on the mpath device,
so only run it for the first device
* Tue Jul 23 2024 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-76
- bundled setuptools: fix CVE-2024-6345
@ -2010,5 +2019,3 @@ are located on corosync cluster nodes.
* Mon Mar 11 2013 Marek Grac <mgrac@redhat.com> - 4.0.0-1
- new upstream release
- introducing subpackages