drbd: Fix a race condition that can lead to a BUG()
authorPhilipp Reisner <philipp.reisner@linbit.com>
Tue, 21 Aug 2012 18:34:07 +0000 (20:34 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Fri, 9 Nov 2012 13:08:20 +0000 (14:08 +0100)
If the preconditions for a state change change after the wait_event() we
might hit the BUG() statement in conn_set_state().

With holding the spin_lock while evaluating the condition AND until the
actual state change we ensure the the preconditions can not change anymore.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>

No differences found