fs: dlm: LSFL_CB_DELAY only for kernel lockspaces
authorAlexander Aring <aahringo@redhat.com>
Mon, 15 Aug 2022 19:43:26 +0000 (15:43 -0400)
committerDavid Teigland <teigland@redhat.com>
Tue, 23 Aug 2022 20:02:46 +0000 (15:02 -0500)
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>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/ast.c

index a44cc42b6317115313b5d07f02fcf2aefe93892e..d60a8d8f109df81f6fa701d28d7543420f13c44e 100644 (file)
@@ -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) {