aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_receiver.c
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2012-07-26 08:09:49 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-09 08:05:32 -0500
commit58ffa580a748dd16b1e5ab260bea39cdbd1e94ef (patch)
tree4155bcde6d49f50545bcb1312b6470c64e823d72 /drivers/block/drbd/drbd_receiver.c
parent970fbde1f1ebae0c85bbaed3de83684a58d60fad (diff)
drbd: introduce stop-sector to online verify
We now can schedule only a specific range of sectors for online verify, or interrupt a running verify without interrupting the connection. Had to bump the protocol version differently, we are now 101. Added verify_can_do_stop_sector() { protocol >= 97 && protocol != 100; } Also, the return value convention for worker callbacks has changed, we returned "true/false" for "keep the connection up" in 8.3, we return 0 for success and <= for failure in 8.4. Affected: receive_state() 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.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 7fe6b01618d4..8fddec96dfbe 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -3843,7 +3843,7 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi)
3843 * already decided to close the connection again, 3843 * already decided to close the connection again,
3844 * we must not "re-establish" it here. */ 3844 * we must not "re-establish" it here. */
3845 if (os.conn <= C_TEAR_DOWN) 3845 if (os.conn <= C_TEAR_DOWN)
3846 return false; 3846 return -ECONNRESET;
3847 3847
3848 /* If this is the "end of sync" confirmation, usually the peer disk 3848 /* If this is the "end of sync" confirmation, usually the peer disk
3849 * transitions from D_INCONSISTENT to D_UP_TO_DATE. For empty (0 bits 3849 * transitions from D_INCONSISTENT to D_UP_TO_DATE. For empty (0 bits
@@ -3875,6 +3875,14 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi)
3875 } 3875 }
3876 } 3876 }
3877 3877
3878 /* explicit verify finished notification, stop sector reached. */
3879 if (os.conn == C_VERIFY_T && os.disk == D_UP_TO_DATE &&
3880 peer_state.conn == C_CONNECTED && real_peer_disk == D_UP_TO_DATE) {
3881 ov_out_of_sync_print(mdev);
3882 drbd_resync_finished(mdev);
3883 return 0;
3884 }
3885
3878 /* peer says his disk is inconsistent, while we think it is uptodate, 3886 /* peer says his disk is inconsistent, while we think it is uptodate,
3879 * and this happens while the peer still thinks we have a sync going on, 3887 * and this happens while the peer still thinks we have a sync going on,
3880 * but we think we are already done with the sync. 3888 * but we think we are already done with the sync.