diff options
author | NeilBrown <neilb@suse.de> | 2005-11-28 16:44:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-28 17:42:25 -0500 |
commit | b5ab28a3b81381103b686ff6b9d2f5fbb944bc8c (patch) | |
tree | 01756ec41c40b0b0fb101c7dc3ee856a745c2e41 /drivers/md/raid6main.c | |
parent | 700e432d8364ce59c521abbe03a522051610ebc2 (diff) |
[PATCH] md: fix problem with raid6 intent bitmap
When doing a recovery, we need to know whether the array will still be
degraded after the recovery has finished, so we can know whether bits can be
clearred yet or not. This patch performs the required check.
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/raid6main.c')
-rw-r--r-- | drivers/md/raid6main.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c index 17d88d90d1ef..00da37848d05 100644 --- a/drivers/md/raid6main.c +++ b/drivers/md/raid6main.c | |||
@@ -1702,6 +1702,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1702 | int data_disks = raid_disks - 2; | 1702 | int data_disks = raid_disks - 2; |
1703 | sector_t max_sector = mddev->size << 1; | 1703 | sector_t max_sector = mddev->size << 1; |
1704 | int sync_blocks; | 1704 | int sync_blocks; |
1705 | int still_degraded = 0; | ||
1706 | int i; | ||
1705 | 1707 | ||
1706 | if (sector_nr >= max_sector) { | 1708 | if (sector_nr >= max_sector) { |
1707 | /* just being told to finish up .. nothing much to do */ | 1709 | /* just being told to finish up .. nothing much to do */ |
@@ -1710,7 +1712,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1710 | if (mddev->curr_resync < max_sector) /* aborted */ | 1712 | if (mddev->curr_resync < max_sector) /* aborted */ |
1711 | bitmap_end_sync(mddev->bitmap, mddev->curr_resync, | 1713 | bitmap_end_sync(mddev->bitmap, mddev->curr_resync, |
1712 | &sync_blocks, 1); | 1714 | &sync_blocks, 1); |
1713 | else /* compelted sync */ | 1715 | else /* completed sync */ |
1714 | conf->fullsync = 0; | 1716 | conf->fullsync = 0; |
1715 | bitmap_close_sync(mddev->bitmap); | 1717 | bitmap_close_sync(mddev->bitmap); |
1716 | 1718 | ||
@@ -1748,7 +1750,16 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1748 | */ | 1750 | */ |
1749 | schedule_timeout_uninterruptible(1); | 1751 | schedule_timeout_uninterruptible(1); |
1750 | } | 1752 | } |
1751 | bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 0); | 1753 | /* Need to check if array will still be degraded after recovery/resync |
1754 | * We don't need to check the 'failed' flag as when that gets set, | ||
1755 | * recovery aborts. | ||
1756 | */ | ||
1757 | for (i=0; i<mddev->raid_disks; i++) | ||
1758 | if (conf->disks[i].rdev == NULL) | ||
1759 | still_degraded = 1; | ||
1760 | |||
1761 | bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, still_degraded); | ||
1762 | |||
1752 | spin_lock(&sh->lock); | 1763 | spin_lock(&sh->lock); |
1753 | set_bit(STRIPE_SYNCING, &sh->state); | 1764 | set_bit(STRIPE_SYNCING, &sh->state); |
1754 | clear_bit(STRIPE_INSYNC, &sh->state); | 1765 | clear_bit(STRIPE_INSYNC, &sh->state); |