summaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_req.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-12-23 13:24:33 (GMT)
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 10:45:26 (GMT)
commitda0a78161d2b2da4819a1f05a38bb1dcbe02d951 (patch)
tree2228b9b03e645d5339b812c6330b44756675b36c /drivers/block/drbd/drbd_req.c
parentd612d309e4c8401ad94c531678b59c4a8b7c41ce (diff)
downloadlinux-fsl-qoriq-da0a78161d2b2da4819a1f05a38bb1dcbe02d951.tar.xz
drbd: Be more careful with SyncSource -> Ahead transitions
We may not get from SyncSource to Ahead if we have sent some P_RS_DATA_REPLY packets to the peer and are waiting for P_WRITE_ACK. Again, this is not relevant for proper tuned systems, but makes sure that the not-tuned system does not get diverging bitmaps. 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_req.c')
-rw-r--r--drivers/block/drbd/drbd_req.c8
1 files changed, 7 insertions, 1 deletions
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)