dlm_controld: be sure we stop lockspaces before shutdown and add yaml file

This commit is contained in:
zouzhimin 2024-04-29 02:36:18 +08:00
parent ea766e1139
commit 3b94631788
3 changed files with 65 additions and 3 deletions

View File

@ -1,6 +1,6 @@
Name: dlm Name: dlm
Version: 4.2.0 Version: 4.2.0
Release: 7 Release: 8
License: GPLv2 and GPLv2+ and LGPLv2+ License: GPLv2 and GPLv2+ and LGPLv2+
Group: System Environment/Kernel Group: System Environment/Kernel
Summary: dlm control daemon and tool Summary: dlm control daemon and tool
@ -19,6 +19,7 @@ Patch0003: update-Linux-kernel-implementations.patch
Patch0004: Revert-treewide-add-fcf-protection-full-to-CFLAGS.patch Patch0004: Revert-treewide-add-fcf-protection-full-to-CFLAGS.patch
Patch0005: build-dlm_controld-disable-annobin-plugin.patch Patch0005: build-dlm_controld-disable-annobin-plugin.patch
Patch0006: dlm_tool-fix-missing-fclose-calls.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: %{name}-lib = %{version}-%{release}
Requires: corosync >= 3.1.0 Requires: corosync >= 3.1.0
@ -102,6 +103,9 @@ install -Dm 0644 init/dlm.sysconfig %{buildroot}/etc/sysconfig/dlm
%{_libdir}/pkgconfig/*.pc %{_libdir}/pkgconfig/*.pc
%changelog %changelog
* Mon May 06 2024 zouzhimin <zouzhimin@kylinos.cn> - 4.2.0-8
- dlm_controld: be sure we stop lockspaces before shutdown and add yaml file
* Mon Apr 29 2024 zouzhimin <zouzhimin@kylinos.cn> - 4.2.0-7 * Mon Apr 29 2024 zouzhimin <zouzhimin@kylinos.cn> - 4.2.0-7
- dlm_tool: fix missing fclose calls - dlm_tool: fix missing fclose calls

4
dlm.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: git
src_repo: https://pagure.io/dlm.git
tag_prefix: ^
seperator: .

View File

@ -0,0 +1,54 @@
From e74cc7ee33481dd31d4149b8d8af1b5e364f6294 Mon Sep 17 00:00:00 2001
From: Alexander Aring <aahringo@redhat.com>
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