]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitfdf4cd634640f13b07ae2c21403eea7002892231
tree58944a50286630dcff9c3122552b9fe556d19e28
parent4d967a318508b7ed15bc6bcf398d88d28785239e
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