Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32235
b: refs/heads/master
c: ff4e8d9
h: refs/heads/master
i:
  32233: 4e4cb0a
  32231: bbbb3eb
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jul 10, 2006
1 parent 4e5bf73 commit 2339f03
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b8c9de05c2a860fe6b02fedcb48763bcee648b3
refs/heads/master: ff4e8d9a9f46e3a7f89d14ade52fe5d53a82c022
10 changes: 6 additions & 4 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -2719,7 +2719,7 @@ static ssize_t
sync_speed_show(mddev_t *mddev, char *page)
{
unsigned long resync, dt, db;
resync = (mddev->curr_resync - atomic_read(&mddev->recovery_active));
resync = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active));
dt = ((jiffies - mddev->resync_mark) / HZ);
if (!dt) dt++;
db = resync - (mddev->resync_mark_cnt);
Expand Down Expand Up @@ -4687,12 +4687,13 @@ static void status_resync(struct seq_file *seq, mddev_t * mddev)
*/
dt = ((jiffies - mddev->resync_mark) / HZ);
if (!dt) dt++;
db = resync - (mddev->resync_mark_cnt/2);
rt = (dt * ((unsigned long)(max_blocks-resync) / (db/100+1)))/100;
db = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active))
- mddev->resync_mark_cnt;
rt = (dt * ((unsigned long)(max_blocks-resync) / (db/2/100+1)))/100;

seq_printf(seq, " finish=%lu.%lumin", rt / 60, (rt % 60)/6);

seq_printf(seq, " speed=%ldK/sec", db/dt);
seq_printf(seq, " speed=%ldK/sec", db/2/dt);
}

static void *md_seq_start(struct seq_file *seq, loff_t *pos)
Expand Down Expand Up @@ -5203,6 +5204,7 @@ void md_do_sync(mddev_t *mddev)

j += sectors;
if (j>1) mddev->curr_resync = j;
mddev->curr_mark_cnt = io_sectors;
if (last_check == 0)
/* this is the earliers that rebuilt will be
* visible in /proc/mdstat
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ static struct stripe_head *get_active_stripe(raid5_conf_t *conf, sector_t sector
} else {
if (!test_bit(STRIPE_HANDLE, &sh->state))
atomic_inc(&conf->active_stripes);
if (list_empty(&sh->lru))
if (list_empty(&sh->lru) &&
!test_bit(STRIPE_EXPANDING, &sh->state))
BUG();
list_del_init(&sh->lru);
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/raid/md_k.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ struct mddev_s

struct mdk_thread_s *thread; /* management thread */
struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */
sector_t curr_resync; /* blocks scheduled */
sector_t curr_resync; /* last block scheduled */
unsigned long resync_mark; /* a recent timestamp */
sector_t resync_mark_cnt;/* blocks written at resync_mark */
sector_t curr_mark_cnt; /* blocks scheduled now */

sector_t resync_max_sectors; /* may be set by personality */

Expand Down

0 comments on commit 2339f03

Please sign in to comment.