cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCHv2 dlm-tool 8/9] dlm_controld: be sure we stop lockspaces before shutdown
Date: Tue,  7 Mar 2023 12:13:06 -0500	[thread overview]
Message-ID: <20230307171307.2785162-9-aahringo@redhat.com> (raw)
In-Reply-To: <20230307171307.2785162-1-aahringo@redhat.com>

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.31.1


  parent reply	other threads:[~2023-03-07 17:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 17:12 [Cluster-devel] [PATCHv2 dlm-tool 0/9] dlm-tool: pending fixes/cleanups dlm-tool patches Alexander Aring
2023-03-07 17:12 ` [Cluster-devel] [PATCHv2 dlm-tool 1/9] dlm_tool: add fail functionality if dump failed Alexander Aring
2023-03-07 17:13 ` [Cluster-devel] [PATCHv2 dlm-tool 2/9] dlm_controld: always create logdir Alexander Aring
2023-03-07 17:13 ` [Cluster-devel] [PATCHv2 dlm-tool 3/9] dlm_controld: move processing of saved messages to plock level Alexander Aring
2023-03-07 17:13 ` [Cluster-devel] [PATCHv2 dlm-tool 4/9] dlm_controld: remove ls parameter Alexander Aring
2023-03-07 17:13 ` [Cluster-devel] [PATCHv2 dlm-tool 5/9] dlm_controld: constify timeval of dt_usec() Alexander Aring
2023-03-07 17:13 ` [Cluster-devel] [PATCHv2 dlm-tool 6/9] dlm_controld: add gcc format printf attribute to log_level Alexander Aring
2023-03-07 17:13 ` [Cluster-devel] [PATCHv2 dlm-tool 7/9] dlm_controld: use write_result() Alexander Aring
2023-03-07 17:13 ` Alexander Aring [this message]
2023-03-07 17:13 ` [Cluster-devel] [PATCHv2 dlm-tool 9/9] dlm_controld: constify name_in in log_level() Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230307171307.2785162-9-aahringo@redhat.com \
    --to=aahringo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).