]> git.baikalelectronics.ru Git - kernel.git/commit
drbd: fix a race stopping the worker thread
authorLars Ellenberg <lars.ellenberg@linbit.com>
Fri, 27 Dec 2013 16:17:25 +0000 (17:17 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 10 Jul 2014 16:34:50 +0000 (18:34 +0200)
commit08b6f54503f99967f0dc92493fad075aaadd090e
tree3e45ac841a66fe27df95d6253cc88be781dd3bd8
parent667d7b80904961aa50d9d436f69235ba4b6e489b
drbd: fix a race stopping the worker thread

We may implicitly call drbd_send() from inside wait_for_work(),
via maybe_send_barrier().

If the "stop" signal was send just before that, drbd_send() would call
flush_signals(), and we would run an unbounded schedule() afterwards.

Fix: check for thread_state == RUNNING before we schedule()

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_worker.c