fix in-kernel configuration serialization
authorLars Ellenberg <lars.ellenberg@linbit.com>
Mon, 16 Nov 2009 14:48:54 +0000 (15:48 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Tue, 24 Nov 2009 17:11:05 +0000 (18:11 +0100)
this is uncritical, as we still also serialize in userland,
but to correctly serialize on the CONFIG_PENDING bit,
it must be wait_event(state_wait, \!test_and_set_bit)

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

index e2a5875a07b1cbd181046913627b25ba409c5e9f..436a090b532b4ac21850f18ece8d4d487322148e 100644 (file)
@@ -733,7 +733,7 @@ void drbd_setup_queue_param(struct drbd_conf *mdev, unsigned int max_seg_s) __mu
  */
 static void drbd_reconfig_start(struct drbd_conf *mdev)
 {
-       wait_event(mdev->state_wait, test_and_set_bit(CONFIG_PENDING, &mdev->flags));
+       wait_event(mdev->state_wait, !test_and_set_bit(CONFIG_PENDING, &mdev->flags));
        wait_event(mdev->state_wait, !test_bit(DEVICE_DYING, &mdev->flags));
        drbd_thread_start(&mdev->worker);
 }