aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_worker.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/drbd/drbd_worker.c')
-rw-r--r--drivers/block/drbd/drbd_worker.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index d97a811ad0d2..4672f2f37b51 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -1289,6 +1289,14 @@ int drbd_alter_sa(struct drbd_conf *mdev, int na)
1289 return retcode; 1289 return retcode;
1290} 1290}
1291 1291
1292static void ping_peer(struct drbd_conf *mdev)
1293{
1294 clear_bit(GOT_PING_ACK, &mdev->flags);
1295 request_ping(mdev);
1296 wait_event(mdev->misc_wait,
1297 test_bit(GOT_PING_ACK, &mdev->flags) || mdev->state.conn < C_CONNECTED);
1298}
1299
1292/** 1300/**
1293 * drbd_start_resync() - Start the resync process 1301 * drbd_start_resync() - Start the resync process
1294 * @mdev: DRBD device. 1302 * @mdev: DRBD device.
@@ -1383,9 +1391,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
1383 1391
1384 if (mdev->rs_total == 0) { 1392 if (mdev->rs_total == 0) {
1385 /* Peer still reachable? Beware of failing before-resync-target handlers! */ 1393 /* Peer still reachable? Beware of failing before-resync-target handlers! */
1386 request_ping(mdev); 1394 ping_peer(mdev);
1387 __set_current_state(TASK_INTERRUPTIBLE);
1388 schedule_timeout(mdev->net_conf->ping_timeo*HZ/9); /* 9 instead 10 */
1389 drbd_resync_finished(mdev); 1395 drbd_resync_finished(mdev);
1390 return; 1396 return;
1391 } 1397 }