From 7f09de451c8a8ab7c25cde81b627f975e4820cae Mon Sep 17 00:00:00 2001 From: zouzhimin Date: Mon, 29 Apr 2024 02:36:18 +0800 Subject: [PATCH] dlm_controld: be sure we stop lockspaces before shutdown and add yaml file (cherry picked from commit 3b946317883200ce844592dd97a6db0d66accf93) --- dlm.spec | 10 ++-- dlm.yaml | 4 ++ ...e-we-stop-lockspaces-before-shutdown.patch | 54 +++++++++++++++++++ 3 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 dlm.yaml create mode 100644 dlm_controld-be-sure-we-stop-lockspaces-before-shutdown.patch diff --git a/dlm.spec b/dlm.spec index 78e8077..8f1f5d2 100644 --- a/dlm.spec +++ b/dlm.spec @@ -1,6 +1,6 @@ Name: dlm Version: 4.2.0 -Release: 7 +Release: 8 License: GPLv2 and GPLv2+ and LGPLv2+ Group: System Environment/Kernel Summary: dlm control daemon and tool @@ -12,13 +12,14 @@ BuildRequires: libxml2-devel BuildRequires: systemd-units BuildRequires: systemd-devel BuildRequires: annobin -Source0: https://releases.pagure.org/dlm/%{name}-%{version}.tar.gz -Patch0001: 0030-dlm_controld-remove-unnecessary-header-include.patch +Source0: https://releases.pagure.org/dlm/%{name}-%{version}.tar.gz +Patch0001: 0030-dlm_controld-remove-unnecessary-header-include.patch Patch0002: fix-various-deadcode-issues.patch Patch0003: update-Linux-kernel-implementations.patch Patch0004: Revert-treewide-add-fcf-protection-full-to-CFLAGS.patch Patch0005: build-dlm_controld-disable-annobin-plugin.patch Patch0006: dlm_tool-fix-missing-fclose-calls.patch +Patch0007: dlm_controld-be-sure-we-stop-lockspaces-before-shutdown.patch Requires: %{name}-lib = %{version}-%{release} Requires: corosync >= 3.1.0 @@ -102,6 +103,9 @@ install -Dm 0644 init/dlm.sysconfig %{buildroot}/etc/sysconfig/dlm %{_libdir}/pkgconfig/*.pc %changelog +* Mon May 06 2024 zouzhimin - 4.2.0-8 +- dlm_controld: be sure we stop lockspaces before shutdown and add yaml file + * Mon Apr 29 2024 zouzhimin - 4.2.0-7 - dlm_tool: fix missing fclose calls diff --git a/dlm.yaml b/dlm.yaml new file mode 100644 index 0000000..f23f65e --- /dev/null +++ b/dlm.yaml @@ -0,0 +1,4 @@ +version_control: git +src_repo: https://pagure.io/dlm.git +tag_prefix: ^ +seperator: . diff --git a/dlm_controld-be-sure-we-stop-lockspaces-before-shutdown.patch b/dlm_controld-be-sure-we-stop-lockspaces-before-shutdown.patch new file mode 100644 index 0000000..7926e68 --- /dev/null +++ b/dlm_controld-be-sure-we-stop-lockspaces-before-shutdown.patch @@ -0,0 +1,54 @@ +From e74cc7ee33481dd31d4149b8d8af1b5e364f6294 Mon Sep 17 00:00:00 2001 +From: Alexander Aring +Date: Thu, 23 Feb 2023 10:36:12 -0500 +Subject: [PATCH] dlm_controld: be sure we stop lockspaces before shutdown + +The dlm_controld shutdown process will drop all dlm configfs entries of +dlm communication settings regarding corosync address configuration. +This will end in an socket close in the dlm subsystem of the connection +which belongs to it. Newly introduced kernel warnings will check if the +lockspace is stopped before we close the socket connection. This is +necessary because no new dlm messages should be triggered afterwards. To +be sure dlm_controld does stop the lockspaces we will make sure that it +does it always in close_cpg_daemon. Currently there is a missing handle +to stop all lockspaces when there is no cpg_handle_daemon anymore. +--- + dlm_controld/daemon_cpg.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/dlm_controld/daemon_cpg.c b/dlm_controld/daemon_cpg.c +index 2e0634d4..10c80ddc 100644 +--- a/dlm_controld/daemon_cpg.c ++++ b/dlm_controld/daemon_cpg.c +@@ -2527,6 +2527,15 @@ int setup_cpg_daemon(void) + return -1; + } + ++static void stop_lockspaces(void) ++{ ++ struct lockspace *ls; ++ ++ list_for_each_entry(ls, &lockspaces, list) { ++ cpg_stop_kernel(ls); ++ } ++} ++ + void close_cpg_daemon(void) + { + struct lockspace *ls; +@@ -2534,8 +2543,11 @@ void close_cpg_daemon(void) + struct cpg_name name; + int i = 0; + +- if (!cpg_handle_daemon) ++ if (!cpg_handle_daemon) { ++ stop_lockspaces(); + return; ++ } ++ + if (cluster_down) + goto fin; + +-- +2.25.1 + -- Gitee