fs: dlm: let dlm_add_cb queue work after resume only
authorAlexander Aring <aahringo@redhat.com>
Thu, 27 Oct 2022 20:45:16 +0000 (16:45 -0400)
committerDavid Teigland <teigland@redhat.com>
Tue, 8 Nov 2022 18:59:41 +0000 (12:59 -0600)
We should allow dlm_add_cb() to call queue_work() only after the
recovery queued pending for delayed lkbs. This patch will move the
switch LSFL_CB_DELAY after the delayed lkb work was processed.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/ast.c

index d60a8d8f109df81f6fa701d28d7543420f13c44e..6e07c151ad2886e1867a2d6694d235d33da70610 100644 (file)
@@ -308,8 +308,6 @@ void dlm_callback_resume(struct dlm_ls *ls)
        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) {
@@ -320,6 +318,8 @@ more:
                        break;
        }
        empty = list_empty(&ls->ls_cb_delay);
+       if (empty)
+               clear_bit(LSFL_CB_DELAY, &ls->ls_flags);
        mutex_unlock(&ls->ls_cb_mutex);
 
        sum += count;