diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2014-11-10 17:21:12 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-11-10 17:27:37 +0100 |
commit | ff8bd88b73fad369a12465dfa52ad5c0bf088ced (patch) | |
tree | f142942ea9b5529bc82591da749eee816f56d4bc /drivers/block/drbd/drbd_receiver.c | |
parent | drbd: fix race between role change and handshake (diff) | |
download | linux-ff8bd88b73fad369a12465dfa52ad5c0bf088ced.tar.xz linux-ff8bd88b73fad369a12465dfa52ad5c0bf088ced.zip |
drbd: fix resync throttling initialization
If for some reason DRBD resync was the only activity on a backend
device, drbd_rs_c_min_rate_throttle() would mistakenly decide that it is
still initialization time, and keep throttling the resync.
This patch explicitly initializes ->rs_last_events to the current
backend event counters, and drops the rs_last_events == 0 from the
throttle condition.
Reported-by: Mikhail Sugakov <msugakov@amazon.de>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 6960fb064731..d169b4a79267 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -2482,7 +2482,7 @@ bool drbd_rs_c_min_rate_throttle(struct drbd_device *device) atomic_read(&device->rs_sect_ev); if (atomic_read(&device->ap_actlog_cnt) - || !device->rs_last_events || curr_events - device->rs_last_events > 64) { + || curr_events - device->rs_last_events > 64) { unsigned long rs_left; int i; |