aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_receiver.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-07-18 09:45:15 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-05-09 09:15:44 -0400
commit80f9fd55a66a6843373330901564ef2d9c7fb050 (patch)
tree303760a80bbcd543af1cd68c23816f549c6c9a06 /drivers/block/drbd/drbd_receiver.c
parentfd2491f4a4a403b376f71a336a36848158efb0fe (diff)
drbd: Cleanup all epoch objects upon connection loss
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r--drivers/block/drbd/drbd_receiver.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index a85bbe1bbc2b..bb92671d1f16 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1001,13 +1001,14 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev,
1001 1001
1002 if (epoch_size != 0 && 1002 if (epoch_size != 0 &&
1003 atomic_read(&epoch->active) == 0 && 1003 atomic_read(&epoch->active) == 0 &&
1004 test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags)) { 1004 (test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags) || ev & EV_CLEANUP)) {
1005 if (!(ev & EV_CLEANUP)) { 1005 if (!(ev & EV_CLEANUP)) {
1006 spin_unlock(&mdev->epoch_lock); 1006 spin_unlock(&mdev->epoch_lock);
1007 drbd_send_b_ack(mdev, epoch->barrier_nr, epoch_size); 1007 drbd_send_b_ack(mdev, epoch->barrier_nr, epoch_size);
1008 spin_lock(&mdev->epoch_lock); 1008 spin_lock(&mdev->epoch_lock);
1009 } 1009 }
1010 dec_unacked(mdev); 1010 if (test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags))
1011 dec_unacked(mdev);
1011 1012
1012 if (mdev->current_epoch != epoch) { 1013 if (mdev->current_epoch != epoch) {
1013 next_epoch = list_entry(epoch->list.next, struct drbd_epoch, list); 1014 next_epoch = list_entry(epoch->list.next, struct drbd_epoch, list);