Blame SOURCES/0057-apply-multipath_component_detection-0-to-duplicate-P.patch

4d51e5
From 3f297c1b3bebcb8812db882f369fbb4c43f4ceb3 Mon Sep 17 00:00:00 2001
4d51e5
From: David Teigland <teigland@redhat.com>
4d51e5
Date: Mon, 25 Jul 2022 13:50:43 -0500
4d51e5
Subject: [PATCH] apply multipath_component_detection=0 to duplicate PV
4d51e5
 handling
4d51e5
4d51e5
multipath_component_detection=0 has always applied to the filter-based
4d51e5
component detection.  Also apply this setting to the duplicate-PV
4d51e5
handling which also eliminates multipath components (based on duplicate
4d51e5
PVs having the same wwid.)
4d51e5
4d51e5
(cherry picked from commit 99ce09ae778c2cc4aa2611e425bba5287b8b9513)
4d51e5
---
4d51e5
 lib/cache/lvmcache.c                  |  3 +++
4d51e5
 test/shell/duplicate-pvs-multipath.sh | 10 +++++++---
4d51e5
 2 files changed, 10 insertions(+), 3 deletions(-)
4d51e5
4d51e5
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
4d51e5
index 61a2fee6d..04e9f0605 100644
4d51e5
--- a/lib/cache/lvmcache.c
4d51e5
+++ b/lib/cache/lvmcache.c
4d51e5
@@ -640,6 +640,9 @@ static int _all_multipath_components(struct cmd_context *cmd, struct lvmcache_in
4d51e5
 
4d51e5
 	*dev_mpath = NULL;
4d51e5
 
4d51e5
+	if (!find_config_tree_bool(cmd, devices_multipath_component_detection_CFG, NULL))
4d51e5
+		return 0;
4d51e5
+
4d51e5
 	/* This function only makes sense with more than one dev. */
4d51e5
 	if ((info && dm_list_empty(altdevs)) || (!info && (dm_list_size(altdevs) == 1))) {
4d51e5
 		log_debug("Skip multipath component checks with single device for PVID %s", pvid);
4d51e5
diff --git a/test/shell/duplicate-pvs-multipath.sh b/test/shell/duplicate-pvs-multipath.sh
4d51e5
index 59c15b0d4..bc98d2d5a 100644
4d51e5
--- a/test/shell/duplicate-pvs-multipath.sh
4d51e5
+++ b/test/shell/duplicate-pvs-multipath.sh
4d51e5
@@ -24,9 +24,13 @@ modprobe --dry-run scsi_debug || skip
4d51e5
 multipath -l || skip
4d51e5
 multipath -l | grep scsi_debug && skip
4d51e5
 
4d51e5
-# Turn off multipath_component_detection so that the duplicate
4d51e5
-# resolution of mpath components is used.
4d51e5
-aux lvmconf 'devices/multipath_component_detection = 0'
4d51e5
+# FIXME: setting multipath_component_detection=0 now also disables
4d51e5
+# the wwid-based mpath component detection, so this test will need
4d51e5
+# to find another way to disable only the filter-mpath code (using
4d51e5
+# sysfs and multipath/wwids) while keeping the code enabled that
4d51e5
+# eliminates duplicates based on their matching wwids which this
4d51e5
+# tries to test.
4d51e5
+
4d51e5
 # Prevent wwids from being used for filtering.
4d51e5
 aux lvmconf 'devices/multipath_wwids_file = "/dev/null"'
4d51e5
 # Need to use /dev/mapper/mpath
4d51e5
-- 
4d51e5
2.37.1
4d51e5