drbd: Silenced an assert that could triggered after changing write ordering method
authorPhilipp Reisner <philipp.reisner@linbit.com>
Tue, 29 Dec 2009 14:56:01 +0000 (15:56 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 31 Dec 2009 08:33:09 +0000 (09:33 +0100)
Immediately after changing the write ordering method, the epoch can already
be finished at this point.

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

index 259c1351b1528da954d446edc4b984bcea2e2a39..a6d266ee7e2ad9d7835cf30cb515b3f085c98b30 100644 (file)
@@ -1201,10 +1201,11 @@ static int receive_Barrier(struct drbd_conf *mdev, struct p_header *h)
 
        case WO_bdev_flush:
        case WO_drain_io:
-               D_ASSERT(rv == FE_STILL_LIVE);
-               set_bit(DE_BARRIER_IN_NEXT_EPOCH_ISSUED, &mdev->current_epoch->flags);
-               drbd_wait_ee_list_empty(mdev, &mdev->active_ee);
-               rv = drbd_flush_after_epoch(mdev, mdev->current_epoch);
+               if (rv == FE_STILL_LIVE) {
+                       set_bit(DE_BARRIER_IN_NEXT_EPOCH_ISSUED, &mdev->current_epoch->flags);
+                       drbd_wait_ee_list_empty(mdev, &mdev->active_ee);
+                       rv = drbd_flush_after_epoch(mdev, mdev->current_epoch);
+               }
                if (rv == FE_RECYCLED)
                        return TRUE;