summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2010-03-03 02:08:22 +0100
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-03-11 16:01:38 +0100
commit676396d545350a70d922605ec23c2ed26124334a (patch)
treec8e97f6955bdb4719761593f2575de88210a5a15 /drivers
parent580b9767dbdf2c049c4d05330c70ea786ef01016 (diff)
downloadlinux-676396d545350a70d922605ec23c2ed26124334a.tar.gz
linux-676396d545350a70d922605ec23c2ed26124334a.tar.bz2
linux-676396d545350a70d922605ec23c2ed26124334a.zip
fix unit of rs_same_csums accounting
Depending on resync request size, we need to account for more than one bit. Impact: cosmetic If SyncTarget reported correctly 100% equal checksums, the SyncSource usually reported 12% equal checksums instead, because it only counted requests, we typically do 32k resync requests, and the bitmap granularity is still 4k. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/drbd/drbd_worker.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index b453c2bca3be..d97a811ad0d2 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -938,7 +938,8 @@ int w_e_end_csum_rs_req(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
if (eq) {
drbd_set_in_sync(mdev, e->sector, e->size);
- mdev->rs_same_csum++;
+ /* rs_same_csums unit is BM_BLOCK_SIZE */
+ mdev->rs_same_csum += e->size >> BM_BLOCK_SHIFT;
ok = drbd_send_ack(mdev, P_RS_IS_IN_SYNC, e);
} else {
inc_rs_pending(mdev);