Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14732
b: refs/heads/master
c: b5ab28a
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Nov 28, 2005
1 parent 6f05883 commit e0fe7b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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: 700e432d8364ce59c521abbe03a522051610ebc2
refs/heads/master: b5ab28a3b81381103b686ff6b9d2f5fbb944bc8c
15 changes: 13 additions & 2 deletions trunk/drivers/md/raid6main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
int data_disks = raid_disks - 2;
sector_t max_sector = mddev->size << 1;
int sync_blocks;
int still_degraded = 0;
int i;

if (sector_nr >= max_sector) {
/* just being told to finish up .. nothing much to do */
Expand All @@ -1710,7 +1712,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
if (mddev->curr_resync < max_sector) /* aborted */
bitmap_end_sync(mddev->bitmap, mddev->curr_resync,
&sync_blocks, 1);
else /* compelted sync */
else /* completed sync */
conf->fullsync = 0;
bitmap_close_sync(mddev->bitmap);

Expand Down Expand Up @@ -1748,7 +1750,16 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
*/
schedule_timeout_uninterruptible(1);
}
bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 0);
/* Need to check if array will still be degraded after recovery/resync
* We don't need to check the 'failed' flag as when that gets set,
* recovery aborts.
*/
for (i=0; i<mddev->raid_disks; i++)
if (conf->disks[i].rdev == NULL)
still_degraded = 1;

bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, still_degraded);

spin_lock(&sh->lock);
set_bit(STRIPE_SYNCING, &sh->state);
clear_bit(STRIPE_INSYNC, &sh->state);
Expand Down

0 comments on commit e0fe7b5

Please sign in to comment.