Blame SOURCES/0004-vgimportdevices-skip-lvmlockd-locking.patch

b6fb8c
From 074fce5c73c55e7a1547d5efff65a9f96e6db3b1 Mon Sep 17 00:00:00 2001
b6fb8c
From: David Teigland <teigland@redhat.com>
b6fb8c
Date: Mon, 25 Oct 2021 12:11:17 -0500
38b7b2
Subject: [PATCH 04/54] vgimportdevices: skip lvmlockd locking
b6fb8c
b6fb8c
Help bootstrapping existing shared vgs into the devices file.
b6fb8c
Reading the vg in vgimportdevices would require locking to be
b6fb8c
started, but vgchange lockstart won't see the vg if it's not
b6fb8c
in the devices file.  The lvmlockd locks are not protecting
b6fb8c
vg modifications so skipping them here won't be a problem.
b6fb8c
---
b6fb8c
 tools/vgimportdevices.c | 11 +++++++++++
b6fb8c
 1 file changed, 11 insertions(+)
b6fb8c
b6fb8c
diff --git a/tools/vgimportdevices.c b/tools/vgimportdevices.c
b6fb8c
index 3f315f98f..2580613c4 100644
b6fb8c
--- a/tools/vgimportdevices.c
b6fb8c
+++ b/tools/vgimportdevices.c
b6fb8c
@@ -172,6 +172,17 @@ int vgimportdevices(struct cmd_context *cmd, int argc, char **argv)
b6fb8c
 	cmd->filter_regex_with_devices_file = 1;
b6fb8c
 	cmd->create_edit_devices_file = 1;
b6fb8c
 
b6fb8c
+	/*
b6fb8c
+	 * This helps a user bootstrap existing shared VGs into the devices
b6fb8c
+	 * file. Reading the vg to import devices requires locking, but
b6fb8c
+	 * lockstart won't find the vg before it's in the devices file.
b6fb8c
+	 * So, allow importing devices without an lvmlockd lock (in a
b6fb8c
+	 * a shared vg the vg metadata won't be updated with device ids,
b6fb8c
+	 * so the lvmlockd lock isn't protecting vg modification.)
b6fb8c
+	 */
b6fb8c
+	cmd->lockd_gl_disable = 1;
b6fb8c
+	cmd->lockd_vg_disable = 1;
b6fb8c
+
b6fb8c
 	/*
b6fb8c
 	 * For each VG:
b6fb8c
 	 * device_id_add() each PV in the VG
b6fb8c
-- 
38b7b2
2.34.3
b6fb8c