diff options
author | Xiao Ni <xni@redhat.com> | 2014-08-07 09:37:41 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2014-08-07 22:11:25 -0400 |
commit | ac7e50a3835de2321bcc511e4b6fe736c73c830f (patch) | |
tree | 9041467bee34379e121835b03fe81bff383136ea /drivers/md/md.c | |
parent | af5628f05db62c656f994b2346897939b5110d6a (diff) |
md: Recovery speed is wrong
When we calculate the speed of recovery, the numerator that contains
the recovery done sectors. It's need to subtract the sectors which
don't finish recovery.
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 1379b1a3b9ff..eb8c93dff7c6 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -7376,7 +7376,7 @@ void md_do_sync(struct md_thread *thread) | |||
7376 | struct mddev *mddev2; | 7376 | struct mddev *mddev2; |
7377 | unsigned int currspeed = 0, | 7377 | unsigned int currspeed = 0, |
7378 | window; | 7378 | window; |
7379 | sector_t max_sectors,j, io_sectors; | 7379 | sector_t max_sectors,j, io_sectors, recovery_done; |
7380 | unsigned long mark[SYNC_MARKS]; | 7380 | unsigned long mark[SYNC_MARKS]; |
7381 | unsigned long update_time; | 7381 | unsigned long update_time; |
7382 | sector_t mark_cnt[SYNC_MARKS]; | 7382 | sector_t mark_cnt[SYNC_MARKS]; |
@@ -7652,7 +7652,8 @@ void md_do_sync(struct md_thread *thread) | |||
7652 | */ | 7652 | */ |
7653 | cond_resched(); | 7653 | cond_resched(); |
7654 | 7654 | ||
7655 | currspeed = ((unsigned long)(io_sectors-mddev->resync_mark_cnt))/2 | 7655 | recovery_done = io_sectors - atomic_read(&mddev->recovery_active); |
7656 | currspeed = ((unsigned long)(recovery_done - mddev->resync_mark_cnt))/2 | ||
7656 | /((jiffies-mddev->resync_mark)/HZ +1) +1; | 7657 | /((jiffies-mddev->resync_mark)/HZ +1) +1; |
7657 | 7658 | ||
7658 | if (currspeed > speed_min(mddev)) { | 7659 | if (currspeed > speed_min(mddev)) { |