summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/drbd/drbd_int.h1
-rw-r--r--drivers/block/drbd/drbd_receiver.c5
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 473694605da6..0db20cbb4234 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -585,6 +585,7 @@ struct drbd_tl_epoch {
};
struct drbd_epoch {
+ struct drbd_conf *mdev;
struct list_head list;
unsigned int barrier_nr;
atomic_t epoch_size; /* increased on every request added. */
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index f6d1ff2e3ab9..cc5e0b6a88e9 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1152,11 +1152,11 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev,
(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);
+ drbd_send_b_ack(epoch->mdev, epoch->barrier_nr, epoch_size);
spin_lock(&mdev->epoch_lock);
}
if (test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags))
- dec_unacked(mdev);
+ dec_unacked(epoch->mdev);
if (mdev->current_epoch != epoch) {
next_epoch = list_entry(epoch->list.next, struct drbd_epoch, list);
@@ -1349,6 +1349,7 @@ static int receive_Barrier(struct drbd_tconn *tconn, struct packet_info *pi)
inc_unacked(mdev);
mdev->current_epoch->barrier_nr = p->barrier;
+ mdev->current_epoch->mdev = mdev;
rv = drbd_may_finish_epoch(mdev, mdev->current_epoch, EV_GOT_BARRIER_NR);
/* P_BARRIER_ACK may imply that the corresponding extent is dropped from