From 58c61aebdc518e32aa2646364808dbc05d51822b Mon Sep 17 00:00:00 2001 From: Lars Ellenberg Date: Wed, 3 Mar 2010 02:08:22 +0100 Subject: [PATCH 08/16] 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. --- drbd/drbd_worker.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drbd/drbd_worker.c b/drbd/drbd_worker.c index a67db0e..d4c4954 100644 --- a/drbd/drbd_worker.c +++ b/drbd/drbd_worker.c @@ -969,7 +969,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); -- 1.6.3.3