From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH dlm/next] fs: dlm: add dlm_is_member() check if fenced
Date: Wed, 15 Jun 2022 10:14:59 -0400 [thread overview]
Message-ID: <20220615141459.2275135-1-aahringo@redhat.com> (raw)
This patch adds an additional check if the "fenced" node is part of any
lockspace. A node should not be part of any lockspace when it's got
fenced. This is an additional requirement besides that all lockspace
activity should be stopped before calling dlm_midcomms_close().
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/lockspace.c | 5 ++++-
fs/dlm/lockspace.h | 2 +-
fs/dlm/midcomms.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 0c3613d09c5e..a4f492189a08 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -923,12 +923,15 @@ void dlm_stop_lockspaces(void)
log_print("dlm user daemon left %d lockspaces", count);
}
-void dlm_stop_lockspaces_check(void)
+void dlm_stop_lockspaces_check(int nodeid)
{
struct dlm_ls *ls;
spin_lock(&lslist_lock);
list_for_each_entry(ls, &lslist, ls_list) {
+ if (WARN_ON(dlm_is_member(ls, nodeid)))
+ break;
+
if (WARN_ON(!rwsem_is_locked(&ls->ls_in_recovery) ||
!dlm_locking_stopped(ls)))
break;
diff --git a/fs/dlm/lockspace.h b/fs/dlm/lockspace.h
index 306fc4f4ea15..9d1ea1013650 100644
--- a/fs/dlm/lockspace.h
+++ b/fs/dlm/lockspace.h
@@ -19,7 +19,7 @@ struct dlm_ls *dlm_find_lockspace_local(void *id);
struct dlm_ls *dlm_find_lockspace_device(int minor);
void dlm_put_lockspace(struct dlm_ls *ls);
void dlm_stop_lockspaces(void);
-void dlm_stop_lockspaces_check(void);
+void dlm_stop_lockspaces_check(int nodeid);
#endif /* __LOCKSPACE_DOT_H__ */
diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c
index 6489bc22ad61..22037183f565 100644
--- a/fs/dlm/midcomms.c
+++ b/fs/dlm/midcomms.c
@@ -1413,7 +1413,7 @@ int dlm_midcomms_close(int nodeid)
if (nodeid == dlm_our_nodeid())
return 0;
- dlm_stop_lockspaces_check();
+ dlm_stop_lockspaces_check(nodeid);
idx = srcu_read_lock(&nodes_srcu);
/* Abort pending close/remove operation */
--
2.31.1
next reply other threads:[~2022-06-15 14:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 14:14 Alexander Aring [this message]
2022-06-20 2:12 ` [Cluster-devel] [PATCH dlm/next] fs: dlm: add dlm_is_member() check if fenced 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=20220615141459.2275135-1-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).