drbd: Broadcast sync progress no more often than once per second
[firefly-linux-kernel-4.4.55.git] / drivers / block / drbd / drbd_worker.c
index 64a7305c678ae0cc22e22b5608844ea5e28eaadc..424dc7bdf9b7f97500c2f6afa2ec4aa69ef3e1d0 100644 (file)
@@ -1696,6 +1696,10 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
        write_unlock_irq(&global_state_lock);
 
        if (r == SS_SUCCESS) {
+               /* reset rs_last_bcast when a resync or verify is started,
+                * to deal with potential jiffies wrap. */
+               mdev->rs_last_bcast = jiffies - HZ;
+
                dev_info(DEV, "Began resync as %s (will sync %lu KB [%lu bits set]).\n",
                     drbd_conn_str(ns.conn),
                     (unsigned long) mdev->rs_total << (BM_BLOCK_SHIFT-10),