aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index fb50e5642c63..4bd3ccf363bd 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2719,7 +2719,7 @@ static ssize_t
2719sync_speed_show(mddev_t *mddev, char *page) 2719sync_speed_show(mddev_t *mddev, char *page)
2720{ 2720{
2721 unsigned long resync, dt, db; 2721 unsigned long resync, dt, db;
2722 resync = (mddev->curr_resync - atomic_read(&mddev->recovery_active)); 2722 resync = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active));
2723 dt = ((jiffies - mddev->resync_mark) / HZ); 2723 dt = ((jiffies - mddev->resync_mark) / HZ);
2724 if (!dt) dt++; 2724 if (!dt) dt++;
2725 db = resync - (mddev->resync_mark_cnt); 2725 db = resync - (mddev->resync_mark_cnt);
@@ -4687,12 +4687,13 @@ static void status_resync(struct seq_file *seq, mddev_t * mddev)
4687 */ 4687 */
4688 dt = ((jiffies - mddev->resync_mark) / HZ); 4688 dt = ((jiffies - mddev->resync_mark) / HZ);
4689 if (!dt) dt++; 4689 if (!dt) dt++;
4690 db = resync - (mddev->resync_mark_cnt/2); 4690 db = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active))
4691 rt = (dt * ((unsigned long)(max_blocks-resync) / (db/100+1)))/100; 4691 - mddev->resync_mark_cnt;
4692 rt = (dt * ((unsigned long)(max_blocks-resync) / (db/2/100+1)))/100;
4692 4693
4693 seq_printf(seq, " finish=%lu.%lumin", rt / 60, (rt % 60)/6); 4694 seq_printf(seq, " finish=%lu.%lumin", rt / 60, (rt % 60)/6);
4694 4695
4695 seq_printf(seq, " speed=%ldK/sec", db/dt); 4696 seq_printf(seq, " speed=%ldK/sec", db/2/dt);
4696} 4697}
4697 4698
4698static void *md_seq_start(struct seq_file *seq, loff_t *pos) 4699static void *md_seq_start(struct seq_file *seq, loff_t *pos)
@@ -5203,6 +5204,7 @@ void md_do_sync(mddev_t *mddev)
5203 5204
5204 j += sectors; 5205 j += sectors;
5205 if (j>1) mddev->curr_resync = j; 5206 if (j>1) mddev->curr_resync = j;
5207 mddev->curr_mark_cnt = io_sectors;
5206 if (last_check == 0) 5208 if (last_check == 0)
5207 /* this is the earliers that rebuilt will be 5209 /* this is the earliers that rebuilt will be
5208 * visible in /proc/mdstat 5210 * visible in /proc/mdstat