diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2010-05-05 14:53:33 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-05-17 19:26:51 -0400 |
commit | a8cdfd8d3bf0b6d2bbe792f5e74f54ccc6bc1d4f (patch) | |
tree | 6301877820e111e09c3ff4fe9ab7aece59dd71c7 /drivers/block | |
parent | eedf386ae9d9e80a5669107e960090951e62f3a3 (diff) |
drbd: A fixes to the new resync speed code
* Mention P_DELAY_PROBE in the packet naming array
* Do not corrupt the mdev->data.work list in case the timer goes
off before delay_probe_work got handled by the worker
* Do not mod_timer() twice for a single delay_probe pair
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 1 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 210870ed8a79..37380d2c869d 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -268,6 +268,7 @@ static inline const char *cmdname(enum drbd_packets cmd) | |||
268 | [P_CSUM_RS_REQUEST] = "CsumRSRequest", | 268 | [P_CSUM_RS_REQUEST] = "CsumRSRequest", |
269 | [P_RS_IS_IN_SYNC] = "CsumRSIsInSync", | 269 | [P_RS_IS_IN_SYNC] = "CsumRSIsInSync", |
270 | [P_COMPRESSED_BITMAP] = "CBitmap", | 270 | [P_COMPRESSED_BITMAP] = "CBitmap", |
271 | [P_DELAY_PROBE] = "DelayProbe", | ||
271 | [P_MAX_CMD] = NULL, | 272 | [P_MAX_CMD] = NULL, |
272 | }; | 273 | }; |
273 | 274 | ||
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 98785d08cf70..44cc7b415ed4 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -2207,9 +2207,6 @@ static int drbd_send_delay_probe(struct drbd_conf *mdev, struct drbd_socket *ds) | |||
2207 | } | 2207 | } |
2208 | mutex_unlock(&ds->mutex); | 2208 | mutex_unlock(&ds->mutex); |
2209 | 2209 | ||
2210 | mdev->dp_volume_last = mdev->send_cnt; | ||
2211 | mod_timer(&mdev->delay_probe_timer, jiffies + mdev->sync_conf.dp_interval * HZ / 10); | ||
2212 | |||
2213 | return ok; | 2210 | return ok; |
2214 | } | 2211 | } |
2215 | 2212 | ||
@@ -2221,6 +2218,9 @@ static int drbd_send_delay_probes(struct drbd_conf *mdev) | |||
2221 | ok = drbd_send_delay_probe(mdev, &mdev->meta); | 2218 | ok = drbd_send_delay_probe(mdev, &mdev->meta); |
2222 | ok = ok && drbd_send_delay_probe(mdev, &mdev->data); | 2219 | ok = ok && drbd_send_delay_probe(mdev, &mdev->data); |
2223 | 2220 | ||
2221 | mdev->dp_volume_last = mdev->send_cnt; | ||
2222 | mod_timer(&mdev->delay_probe_timer, jiffies + mdev->sync_conf.dp_interval * HZ / 10); | ||
2223 | |||
2224 | return ok; | 2224 | return ok; |
2225 | } | 2225 | } |
2226 | 2226 | ||
@@ -2374,7 +2374,8 @@ static void delay_probe_timer_fn(unsigned long data) | |||
2374 | { | 2374 | { |
2375 | struct drbd_conf *mdev = (struct drbd_conf *) data; | 2375 | struct drbd_conf *mdev = (struct drbd_conf *) data; |
2376 | 2376 | ||
2377 | drbd_queue_work(&mdev->data.work, &mdev->delay_probe_work); | 2377 | if (list_empty(&mdev->delay_probe_work.list)) |
2378 | drbd_queue_work(&mdev->data.work, &mdev->delay_probe_work); | ||
2378 | } | 2379 | } |
2379 | 2380 | ||
2380 | /* Used to send write requests | 2381 | /* Used to send write requests |