diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-01-14 10:03:11 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:45:36 -0500 |
commit | 370a43e7982dd497822097e0ae6022947ac2e7d4 (patch) | |
tree | a501836af9959177a1ef9b6746ab21c3b3af6d94 /drivers/block/drbd/drbd_receiver.c | |
parent | 71c78cfba232de8f61a4b1bbb6e876424d133407 (diff) |
drbd: Work on the Ahead -> SyncSource transition
The test if rs_pending_cnt == 0 was too weak. Using Test for
unacked_cnt == 0 instead. Moved that into the worker.
Since unacked_cnt gets already increased when an P_RS_DATA_REQ
comes in.
Also using a timer to make Ahead -> SyncSource -> Ahead cycles
slower...
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.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 7991183749e3..18cb8b609fe4 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -4392,11 +4392,9 @@ static int got_BarrierAck(struct drbd_conf *mdev, struct p_header80 *h) | |||
4392 | 4392 | ||
4393 | if (mdev->state.conn == C_AHEAD && | 4393 | if (mdev->state.conn == C_AHEAD && |
4394 | atomic_read(&mdev->ap_in_flight) == 0 && | 4394 | atomic_read(&mdev->ap_in_flight) == 0 && |
4395 | atomic_read(&mdev->rs_pending_cnt) == 0 && | 4395 | !test_and_set_bit(AHEAD_TO_SYNC_SOURCE, &mdev->current_epoch->flags)) { |
4396 | list_empty(&mdev->start_resync_work.list)) { | 4396 | mdev->start_resync_timer.expires = jiffies + HZ; |
4397 | struct drbd_work *w = &mdev->start_resync_work; | 4397 | add_timer(&mdev->start_resync_timer); |
4398 | w->cb = w_start_resync; | ||
4399 | drbd_queue_work(&mdev->data.work, w); | ||
4400 | } | 4398 | } |
4401 | 4399 | ||
4402 | return true; | 4400 | return true; |