aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-10-27 11:32:36 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 05:34:49 -0500
commitc4752ef1284519c3baa1c3b19df34a80b4905245 (patch)
tree60585a6a3ad1ff8165e6921f348eb17701b39732 /drivers/block
parent73a01a18b9c28a0fab1131ece5b0a9bc00a879b8 (diff)
drbd: When proxy's buffer drained off go into regular resync mode
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/drbd/drbd_int.h4
-rw-r--r--drivers/block/drbd/drbd_main.c1
-rw-r--r--drivers/block/drbd/drbd_receiver.c9
-rw-r--r--drivers/block/drbd/drbd_worker.c10
4 files changed, 22 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 471331236826..da02cce374c9 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -973,7 +973,8 @@ struct drbd_conf {
973 struct drbd_work resync_work, 973 struct drbd_work resync_work,
974 unplug_work, 974 unplug_work,
975 go_diskless, 975 go_diskless,
976 md_sync_work; 976 md_sync_work,
977 start_resync_work;
977 struct timer_list resync_timer; 978 struct timer_list resync_timer;
978 struct timer_list md_sync_timer; 979 struct timer_list md_sync_timer;
979#ifdef DRBD_DEBUG_MD_SYNC 980#ifdef DRBD_DEBUG_MD_SYNC
@@ -1546,6 +1547,7 @@ extern int w_prev_work_done(struct drbd_conf *, struct drbd_work *, int);
1546extern int w_e_reissue(struct drbd_conf *, struct drbd_work *, int); 1547extern int w_e_reissue(struct drbd_conf *, struct drbd_work *, int);
1547extern int w_restart_disk_io(struct drbd_conf *, struct drbd_work *, int); 1548extern int w_restart_disk_io(struct drbd_conf *, struct drbd_work *, int);
1548extern int w_send_oos(struct drbd_conf *, struct drbd_work *, int); 1549extern int w_send_oos(struct drbd_conf *, struct drbd_work *, int);
1550extern int w_start_resync(struct drbd_conf *, struct drbd_work *, int);
1549 1551
1550extern void resync_timer_fn(unsigned long data); 1552extern void resync_timer_fn(unsigned long data);
1551 1553
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 0dc93f43a476..f49505cf8d0f 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2846,6 +2846,7 @@ void drbd_init_set_defaults(struct drbd_conf *mdev)
2846 INIT_LIST_HEAD(&mdev->unplug_work.list); 2846 INIT_LIST_HEAD(&mdev->unplug_work.list);
2847 INIT_LIST_HEAD(&mdev->go_diskless.list); 2847 INIT_LIST_HEAD(&mdev->go_diskless.list);
2848 INIT_LIST_HEAD(&mdev->md_sync_work.list); 2848 INIT_LIST_HEAD(&mdev->md_sync_work.list);
2849 INIT_LIST_HEAD(&mdev->start_resync_work.list);
2849 INIT_LIST_HEAD(&mdev->bm_io_work.w.list); 2850 INIT_LIST_HEAD(&mdev->bm_io_work.w.list);
2850 2851
2851 mdev->resync_work.cb = w_resync_inactive; 2852 mdev->resync_work.cb = w_resync_inactive;
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 04a08e7541cc..ee9238e59327 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -3279,6 +3279,7 @@ static int receive_sync_uuid(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
3279 3279
3280 wait_event(mdev->misc_wait, 3280 wait_event(mdev->misc_wait,
3281 mdev->state.conn == C_WF_SYNC_UUID || 3281 mdev->state.conn == C_WF_SYNC_UUID ||
3282 mdev->state.conn == C_BEHIND ||
3282 mdev->state.conn < C_CONNECTED || 3283 mdev->state.conn < C_CONNECTED ||
3283 mdev->state.disk < D_NEGOTIATING); 3284 mdev->state.disk < D_NEGOTIATING);
3284 3285
@@ -4338,6 +4339,14 @@ static int got_BarrierAck(struct drbd_conf *mdev, struct p_header80 *h)
4338 4339
4339 tl_release(mdev, p->barrier, be32_to_cpu(p->set_size)); 4340 tl_release(mdev, p->barrier, be32_to_cpu(p->set_size));
4340 4341
4342 if (mdev->state.conn == C_AHEAD &&
4343 atomic_read(&mdev->ap_in_flight) == 0 &&
4344 list_empty(&mdev->start_resync_work.list)) {
4345 struct drbd_work *w = &mdev->start_resync_work;
4346 w->cb = w_start_resync;
4347 drbd_queue_work_front(&mdev->data.work, w);
4348 }
4349
4341 return TRUE; 4350 return TRUE;
4342} 4351}
4343 4352
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index 67499077c482..c9e7cb7c788a 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -742,6 +742,14 @@ static int w_make_ov_request(struct drbd_conf *mdev, struct drbd_work *w, int ca
742 return 1; 742 return 1;
743} 743}
744 744
745
746int w_start_resync(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
747{
748 drbd_start_resync(mdev, C_SYNC_SOURCE);
749
750 return 1;
751}
752
745int w_ov_finished(struct drbd_conf *mdev, struct drbd_work *w, int cancel) 753int w_ov_finished(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
746{ 754{
747 kfree(w); 755 kfree(w);
@@ -1472,7 +1480,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
1472 union drbd_state ns; 1480 union drbd_state ns;
1473 int r; 1481 int r;
1474 1482
1475 if (mdev->state.conn >= C_SYNC_SOURCE) { 1483 if (mdev->state.conn >= C_SYNC_SOURCE && mdev->state.conn < C_AHEAD) {
1476 dev_err(DEV, "Resync already running!\n"); 1484 dev_err(DEV, "Resync already running!\n");
1477 return; 1485 return;
1478 } 1486 }