From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH dlm/next 5/5] fs: dlm: LSFL_CB_DELAY only for kernel lockspaces
Date: Mon, 25 Jul 2022 16:38:35 -0400 [thread overview]
Message-ID: <20220725203835.860277-6-aahringo@redhat.com> (raw)
In-Reply-To: <20220725203835.860277-1-aahringo@redhat.com>
This patch only set/clear the LSFL_CB_DELAY bit when it's actually a
kernel lockspace signaled by if ls->ls_callback_wq is set or not set in
this case. User lockspaces will never evaluate this flag.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/ast.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c
index a44cc42b6317..d60a8d8f109d 100644
--- a/fs/dlm/ast.c
+++ b/fs/dlm/ast.c
@@ -288,12 +288,13 @@ void dlm_callback_stop(struct dlm_ls *ls)
void dlm_callback_suspend(struct dlm_ls *ls)
{
- mutex_lock(&ls->ls_cb_mutex);
- set_bit(LSFL_CB_DELAY, &ls->ls_flags);
- mutex_unlock(&ls->ls_cb_mutex);
+ if (ls->ls_callback_wq) {
+ mutex_lock(&ls->ls_cb_mutex);
+ set_bit(LSFL_CB_DELAY, &ls->ls_flags);
+ mutex_unlock(&ls->ls_cb_mutex);
- if (ls->ls_callback_wq)
flush_workqueue(ls->ls_callback_wq);
+ }
}
#define MAX_CB_QUEUE 25
@@ -304,11 +305,11 @@ void dlm_callback_resume(struct dlm_ls *ls)
int count = 0, sum = 0;
bool empty;
- clear_bit(LSFL_CB_DELAY, &ls->ls_flags);
-
if (!ls->ls_callback_wq)
return;
+ clear_bit(LSFL_CB_DELAY, &ls->ls_flags);
+
more:
mutex_lock(&ls->ls_cb_mutex);
list_for_each_entry_safe(lkb, safe, &ls->ls_cb_delay, lkb_cb_list) {
--
2.31.1
prev parent reply other threads:[~2022-07-25 20:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-25 20:38 [Cluster-devel] [PATCH dlm/next 0/5] fs: dlm: misc cleanups Alexander Aring
2022-07-25 20:38 ` [Cluster-devel] [PATCH dlm/next 1/5] fs: dlm: remove dlm_del_ast prototype Alexander Aring
2022-07-25 20:38 ` [Cluster-devel] [PATCH dlm/next 2/5] fs: dlm: change ls_clear_proc_locks to spinlock Alexander Aring
2022-07-25 20:38 ` [Cluster-devel] [PATCH dlm/next 3/5] fs: dlm: trace user space callbacks Alexander Aring
2022-08-05 18:46 ` Alexander Aring
2022-07-25 20:38 ` [Cluster-devel] [PATCH dlm/next 4/5] fs: dlm: move DLM_LSFL_FS out of uapi Alexander Aring
2022-07-25 20:38 ` Alexander Aring [this message]
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=20220725203835.860277-6-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).