diff options
author | NeilBrown <neilb@suse.de> | 2006-07-10 07:44:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-10 16:24:16 -0400 |
commit | ff4e8d9a9f46e3a7f89d14ade52fe5d53a82c022 (patch) | |
tree | e15fc4d8af0045a3947e3a25844773c6ee50289a /drivers/md/raid5.c | |
parent | 0b8c9de05c2a860fe6b02fedcb48763bcee648b3 (diff) |
[PATCH] md: fix resync speed calculation for restarted resyncs
We introduced 'io_sectors' recently so we could count the sectors that causes
io during resync separate from sectors which didn't cause IO - there can be a
difference if a bitmap is being used to accelerate resync.
However when a speed is reported, we find the number of sectors processed
recently by subtracting an oldish io_sectors count from a current
'curr_resync' count. This is wrong because curr_resync counts all sectors,
not just io sectors.
So, add a field to mddev to store the curren io_sectors separately from
curr_resync, and use that in the calculations.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index a02f35f1a796..dd0d00108a31 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -281,7 +281,8 @@ static struct stripe_head *get_active_stripe(raid5_conf_t *conf, sector_t sector | |||
281 | } else { | 281 | } else { |
282 | if (!test_bit(STRIPE_HANDLE, &sh->state)) | 282 | if (!test_bit(STRIPE_HANDLE, &sh->state)) |
283 | atomic_inc(&conf->active_stripes); | 283 | atomic_inc(&conf->active_stripes); |
284 | if (list_empty(&sh->lru)) | 284 | if (list_empty(&sh->lru) && |
285 | !test_bit(STRIPE_EXPANDING, &sh->state)) | ||
285 | BUG(); | 286 | BUG(); |
286 | list_del_init(&sh->lru); | 287 | list_del_init(&sh->lru); |
287 | } | 288 | } |