Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80f9fd55 authored by Philipp Reisner's avatar Philipp Reisner
Browse files

drbd: Cleanup all epoch objects upon connection loss

parent fd2491f4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1001,12 +1001,13 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev,

		if (epoch_size != 0 &&
		    atomic_read(&epoch->active) == 0 &&
		    test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags)) {
		    (test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags) || ev & EV_CLEANUP)) {
			if (!(ev & EV_CLEANUP)) {
				spin_unlock(&mdev->epoch_lock);
				drbd_send_b_ack(mdev, epoch->barrier_nr, epoch_size);
				spin_lock(&mdev->epoch_lock);
			}
			if (test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags))
				dec_unacked(mdev);

			if (mdev->current_epoch != epoch) {