fs: dlm: fix race between test_bit() and queue_work()
authorAlexander Aring <aahringo@redhat.com>
Mon, 15 Aug 2022 19:43:14 +0000 (15:43 -0400)
committerDavid Teigland <teigland@redhat.com>
Tue, 23 Aug 2022 19:37:14 +0000 (14:37 -0500)
commiteef6ec9bf390e836a6c4029f3620fe49528aa1fe
tree58944a50286630dcff9c3122552b9fe556d19e28
parent30ea3257e8766027c4d8d609dcbd256ff9a76073
fs: dlm: fix race between test_bit() and queue_work()

This patch fixes a race by using ls_cb_mutex around the bit
operations and conditional code blocks for LSFL_CB_DELAY.

The function dlm_callback_stop() expects to stop all callbacks and
flush all currently queued onces. The set_bit() is not enough because
there can still be queue_work() after the workqueue was flushed.
To avoid queue_work() after set_bit(), surround both by ls_cb_mutex.

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