aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_worker.c
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2010-11-05 04:56:33 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 05:18:49 -0500
commit26525618863afcc4aab8b2a83451d37c6f513460 (patch)
tree71a0d52eb8bc30a5abe61bd58098a19fce83658f /drivers/block/drbd/drbd_worker.c
parent4c63f5646e405b5010cc9499419060bf2e838f5b (diff)
drbd: only reset online-verify start sector if verify completed
For network hickups during online-verify, on the next verify triggered, we by default want to resume where it left off. After any replication link interruption, there will be a (possibly empty) resync. Do not reset online-verify start sector if some resync completed, that would defeats the purpose. Only reset the start sector once a verify run is completed. 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_worker.c')
-rw-r--r--drivers/block/drbd/drbd_worker.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index e027446590d3..6cfc5417da8e 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -782,6 +782,7 @@ int drbd_resync_finished(struct drbd_conf *mdev)
782 union drbd_state os, ns; 782 union drbd_state os, ns;
783 struct drbd_work *w; 783 struct drbd_work *w;
784 char *khelper_cmd = NULL; 784 char *khelper_cmd = NULL;
785 int verify_done = 0;
785 786
786 /* Remove all elements from the resync LRU. Since future actions 787 /* Remove all elements from the resync LRU. Since future actions
787 * might set bits in the (main) bitmap, then the entries in the 788 * might set bits in the (main) bitmap, then the entries in the
@@ -818,6 +819,8 @@ int drbd_resync_finished(struct drbd_conf *mdev)
818 spin_lock_irq(&mdev->req_lock); 819 spin_lock_irq(&mdev->req_lock);
819 os = mdev->state; 820 os = mdev->state;
820 821
822 verify_done = (os.conn == C_VERIFY_S || os.conn == C_VERIFY_T);
823
821 /* This protects us against multiple calls (that can happen in the presence 824 /* This protects us against multiple calls (that can happen in the presence
822 of application IO), and against connectivity loss just before we arrive here. */ 825 of application IO), and against connectivity loss just before we arrive here. */
823 if (os.conn <= C_CONNECTED) 826 if (os.conn <= C_CONNECTED)
@@ -827,8 +830,7 @@ int drbd_resync_finished(struct drbd_conf *mdev)
827 ns.conn = C_CONNECTED; 830 ns.conn = C_CONNECTED;
828 831
829 dev_info(DEV, "%s done (total %lu sec; paused %lu sec; %lu K/sec)\n", 832 dev_info(DEV, "%s done (total %lu sec; paused %lu sec; %lu K/sec)\n",
830 (os.conn == C_VERIFY_S || os.conn == C_VERIFY_T) ? 833 verify_done ? "Online verify " : "Resync",
831 "Online verify " : "Resync",
832 dt + mdev->rs_paused, mdev->rs_paused, dbdt); 834 dt + mdev->rs_paused, mdev->rs_paused, dbdt);
833 835
834 n_oos = drbd_bm_total_weight(mdev); 836 n_oos = drbd_bm_total_weight(mdev);
@@ -905,7 +907,8 @@ out:
905 mdev->rs_total = 0; 907 mdev->rs_total = 0;
906 mdev->rs_failed = 0; 908 mdev->rs_failed = 0;
907 mdev->rs_paused = 0; 909 mdev->rs_paused = 0;
908 mdev->ov_start_sector = 0; 910 if (verify_done)
911 mdev->ov_start_sector = 0;
909 912
910 drbd_md_sync(mdev); 913 drbd_md_sync(mdev);
911 914