diff options
author | Neil Brown <neilb@notabene.brown> | 2008-06-27 18:30:52 -0400 |
---|---|---|
committer | Neil Brown <neilb@notabene.brown> | 2008-06-27 18:30:52 -0400 |
commit | 8c2e870a625bd336b2e7a65a97c1836acef07322 (patch) | |
tree | 1d0650ce9affed0bfae754e17bd5a86a563f8037 | |
parent | 543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff) |
Ensure interrupted recovery completed properly (v1 metadata plus bitmap)
If, while assembling an array, we find a device which is not fully
in-sync with the array, it is important to set the "fullsync" flags.
This is an exact analog to the setting of this flag in hot_add_disk
methods.
Currently, only v1.x metadata supports having devices in an array
which are not fully in-sync (it keep track of how in sync they are).
The 'fullsync' flag only makes a difference when a write-intent bitmap
is being used. In this case it tells recovery to ignore the bitmap
and recovery all blocks.
This fix is already in place for raid1, but not raid5/6 or raid10.
So without this fix, a raid1 ir raid4/5/6 array with version 1.x
metadata and a write intent bitmaps, that is stopped in the middle
of a recovery, will appear to complete the recovery instantly
after it is reassembled, but the recovery will not be correct.
If you might have an array like that, issueing
echo repair > /sys/block/mdXX/md/sync_action
will make sure recovery completes properly.
Cc: <stable@kernel.org>
Signed-off-by: Neil Brown <neilb@suse.de>
-rw-r--r-- | drivers/md/raid10.c | 2 | ||||
-rw-r--r-- | drivers/md/raid5.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 1de17da34a95..a71277b640ab 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -2137,6 +2137,8 @@ static int run(mddev_t *mddev) | |||
2137 | !test_bit(In_sync, &disk->rdev->flags)) { | 2137 | !test_bit(In_sync, &disk->rdev->flags)) { |
2138 | disk->head_position = 0; | 2138 | disk->head_position = 0; |
2139 | mddev->degraded++; | 2139 | mddev->degraded++; |
2140 | if (disk->rdev) | ||
2141 | conf->fullsync = 1; | ||
2140 | } | 2142 | } |
2141 | } | 2143 | } |
2142 | 2144 | ||
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index c37e256b1176..475fba4d371e 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -4305,7 +4305,9 @@ static int run(mddev_t *mddev) | |||
4305 | " disk %d\n", bdevname(rdev->bdev,b), | 4305 | " disk %d\n", bdevname(rdev->bdev,b), |
4306 | raid_disk); | 4306 | raid_disk); |
4307 | working_disks++; | 4307 | working_disks++; |
4308 | } | 4308 | } else |
4309 | /* Cannot rely on bitmap to complete recovery */ | ||
4310 | conf->fullsync = 1; | ||
4309 | } | 4311 | } |
4310 | 4312 | ||
4311 | /* | 4313 | /* |