]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drbd: Broadcast sync progress no more often than once per second
authorPhilipp Reisner <philipp.reisner@linbit.com>
Fri, 19 Oct 2012 12:37:47 +0000 (14:37 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Fri, 9 Nov 2012 13:11:43 +0000 (14:11 +0100)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_int.h
drivers/block/drbd/drbd_nl.c
drivers/block/drbd/drbd_worker.c
include/linux/drbd.h

index 057ffed6eb7e2e4ea8b95db964f51e7be6f26e99..784f4eb2ed61c2a13602045ff6e8957002bcf93c 100644 (file)
@@ -965,6 +965,7 @@ struct drbd_conf {
        unsigned long rs_mark_time[DRBD_SYNC_MARKS];
        /* current index into rs_mark_{left,time} */
        int rs_last_mark;
+       unsigned long rs_last_bcast; /* [unit jiffies] */
 
        /* where does the admin want us to start? (sector) */
        sector_t ov_start_sector;
index 298dd3e35e02dde563119bfb33b9e547e95caa5f..d339a2754a8581c811271d95ea14b196d436d907 100644 (file)
@@ -3295,6 +3295,12 @@ void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib)
        unsigned seq;
        int err = -ENOMEM;
 
+       if (sib->sib_reason == SIB_SYNC_PROGRESS &&
+           time_after(jiffies, mdev->rs_last_bcast + HZ))
+               mdev->rs_last_bcast = jiffies;
+       else
+               return;
+
        seq = atomic_inc_return(&drbd_genl_seq);
        msg = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO);
        if (!msg)
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),
index 0b93e5e2e0646a5301e25d0fc988c704d097c1ad..0c5a18ec322ce2b1ef963d8364d868adc3a82f98 100644 (file)
@@ -52,8 +52,8 @@
 #endif
 
 extern const char *drbd_buildtag(void);
-#define REL_VERSION "8.3.11"
-#define API_VERSION 88
+#define REL_VERSION "8.4.2"
+#define API_VERSION 1
 #define PRO_VERSION_MIN 86
 #define PRO_VERSION_MAX 101