summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/block/drbd/drbd_receiver.c3
-rw-r--r--drivers/block/drbd/drbd_req.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index bf865bd..fd0957f 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -4385,10 +4385,11 @@ static int got_BarrierAck(struct drbd_conf *mdev, struct p_header80 *h)
if (mdev->state.conn == C_AHEAD &&
atomic_read(&mdev->ap_in_flight) == 0 &&
+ atomic_read(&mdev->rs_pending_cnt) == 0 &&
list_empty(&mdev->start_resync_work.list)) {
struct drbd_work *w = &mdev->start_resync_work;
w->cb = w_start_resync;
- drbd_queue_work_front(&mdev->data.work, w);
+ drbd_queue_work(&mdev->data.work, w);
}
return true;
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 8891751..a3f6b04 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -1002,7 +1002,13 @@ allocate_barrier:
congested = 1;
}
- if (congested) {
+ if (congested && atomic_read(&mdev->rs_pending_cnt) == 0) {
+ /* rs_pending_cnt must be zero, otherwise the two peers
+ might get different bitmaps. With sane configurations
+ the resync stalls long before we might want to go into
+ AHEAD mode.
+ We could force the resync into PAUSE mode here if
+ rs_pending_cnt is > 0 ... */
queue_barrier(mdev);
if (mdev->net_conf->on_congestion == OC_PULL_AHEAD)