Skip to content

Commit 7a93147

Browse files
Alexander Aringteigland
authored andcommitted
fs: dlm: clear pending bit when queue was empty
This patch clears the DLM_IFL_CB_PENDING_BIT flag which will be set when there is callback work queued when there was no callback to dequeue. It is a buggy case and should never happen, that's why there is a WARN_ON(). However if the case happens we are prepared to somehow recover from it. Cc: stable@vger.kernel.org Fixes: 61bed0b ("fs: dlm: use a non-static queue for callbacks") Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent c6b6d6d commit 7a93147

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

fs/dlm/ast.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,12 @@ void dlm_callback_work(struct work_struct *work)
181181

182182
spin_lock(&lkb->lkb_cb_lock);
183183
rv = dlm_dequeue_lkb_callback(lkb, &cb);
184-
spin_unlock(&lkb->lkb_cb_lock);
185-
186-
if (WARN_ON_ONCE(rv == DLM_DEQUEUE_CALLBACK_EMPTY))
184+
if (WARN_ON_ONCE(rv == DLM_DEQUEUE_CALLBACK_EMPTY)) {
185+
clear_bit(DLM_IFL_CB_PENDING_BIT, &lkb->lkb_iflags);
186+
spin_unlock(&lkb->lkb_cb_lock);
187187
goto out;
188+
}
189+
spin_unlock(&lkb->lkb_cb_lock);
188190

189191
for (;;) {
190192
castfn = lkb->lkb_astfn;

0 commit comments

Comments
 (0)