diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2012-10-19 08:37:47 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-09 08:11:43 -0500 |
commit | 328e0f125bf41f4f33f684db22015f92cb44fe56 (patch) | |
tree | 364b7292db9d7072130080589b579e3fdadf23e6 | |
parent | 518a4d53b2985451a08cb4e5b79deacfe151a38a (diff) |
drbd: Broadcast sync progress no more often than once per second
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 1 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 6 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 4 | ||||
-rw-r--r-- | include/linux/drbd.h | 4 |
4 files changed, 13 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 057ffed6eb7e..784f4eb2ed61 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -965,6 +965,7 @@ struct drbd_conf { | |||
965 | unsigned long rs_mark_time[DRBD_SYNC_MARKS]; | 965 | unsigned long rs_mark_time[DRBD_SYNC_MARKS]; |
966 | /* current index into rs_mark_{left,time} */ | 966 | /* current index into rs_mark_{left,time} */ |
967 | int rs_last_mark; | 967 | int rs_last_mark; |
968 | unsigned long rs_last_bcast; /* [unit jiffies] */ | ||
968 | 969 | ||
969 | /* where does the admin want us to start? (sector) */ | 970 | /* where does the admin want us to start? (sector) */ |
970 | sector_t ov_start_sector; | 971 | sector_t ov_start_sector; |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 298dd3e35e02..d339a2754a85 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -3295,6 +3295,12 @@ void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib) | |||
3295 | unsigned seq; | 3295 | unsigned seq; |
3296 | int err = -ENOMEM; | 3296 | int err = -ENOMEM; |
3297 | 3297 | ||
3298 | if (sib->sib_reason == SIB_SYNC_PROGRESS && | ||
3299 | time_after(jiffies, mdev->rs_last_bcast + HZ)) | ||
3300 | mdev->rs_last_bcast = jiffies; | ||
3301 | else | ||
3302 | return; | ||
3303 | |||
3298 | seq = atomic_inc_return(&drbd_genl_seq); | 3304 | seq = atomic_inc_return(&drbd_genl_seq); |
3299 | msg = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO); | 3305 | msg = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO); |
3300 | if (!msg) | 3306 | if (!msg) |
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 64a7305c678a..424dc7bdf9b7 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -1696,6 +1696,10 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) | |||
1696 | write_unlock_irq(&global_state_lock); | 1696 | write_unlock_irq(&global_state_lock); |
1697 | 1697 | ||
1698 | if (r == SS_SUCCESS) { | 1698 | if (r == SS_SUCCESS) { |
1699 | /* reset rs_last_bcast when a resync or verify is started, | ||
1700 | * to deal with potential jiffies wrap. */ | ||
1701 | mdev->rs_last_bcast = jiffies - HZ; | ||
1702 | |||
1699 | dev_info(DEV, "Began resync as %s (will sync %lu KB [%lu bits set]).\n", | 1703 | dev_info(DEV, "Began resync as %s (will sync %lu KB [%lu bits set]).\n", |
1700 | drbd_conn_str(ns.conn), | 1704 | drbd_conn_str(ns.conn), |
1701 | (unsigned long) mdev->rs_total << (BM_BLOCK_SHIFT-10), | 1705 | (unsigned long) mdev->rs_total << (BM_BLOCK_SHIFT-10), |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index 0b93e5e2e064..0c5a18ec322c 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -52,8 +52,8 @@ | |||
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | extern const char *drbd_buildtag(void); | 54 | extern const char *drbd_buildtag(void); |
55 | #define REL_VERSION "8.3.11" | 55 | #define REL_VERSION "8.4.2" |
56 | #define API_VERSION 88 | 56 | #define API_VERSION 1 |
57 | #define PRO_VERSION_MIN 86 | 57 | #define PRO_VERSION_MIN 86 |
58 | #define PRO_VERSION_MAX 101 | 58 | #define PRO_VERSION_MAX 101 |
59 | 59 | ||