diff options
author | NeilBrown <neilb@suse.de> | 2006-06-26 03:27:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:39 -0400 |
commit | 07d84d109d8beedd68df9da2e4e9f25c8217e7fb (patch) | |
tree | 09b4749cb2ff1759c076c362891a28ceda2b8520 /drivers/md/raid1.c | |
parent | 3285edf152cefff482f95ceb90b1bd46ac169df1 (diff) |
[PATCH] md: Allow re-add to work on array without bitmaps
When an array has a bitmap, a device can be removed and re-added and only
blocks changes since the removal (as recorded in the bitmap) will be resynced.
It should be possible to do a similar thing to arrays without bitmaps. i.e.
if a device is removed and re-added and *no* changes have been made in the
interim, then the add should not require a resync.
This patch allows that option. This means that when assembling an array one
device at a time (e.g. during device discovery) the array can be enabled
read-only as soon as enough devices are available, but extra devices can still
be added without causing a resync.
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/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index b3cfae41f769..cead918578a7 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1625,6 +1625,12 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1625 | /* before building a request, check if we can skip these blocks.. | 1625 | /* before building a request, check if we can skip these blocks.. |
1626 | * This call the bitmap_start_sync doesn't actually record anything | 1626 | * This call the bitmap_start_sync doesn't actually record anything |
1627 | */ | 1627 | */ |
1628 | if (mddev->bitmap == NULL && | ||
1629 | mddev->recovery_cp == MaxSector && | ||
1630 | conf->fullsync == 0) { | ||
1631 | *skipped = 1; | ||
1632 | return max_sector - sector_nr; | ||
1633 | } | ||
1628 | if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) && | 1634 | if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) && |
1629 | !conf->fullsync && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { | 1635 | !conf->fullsync && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { |
1630 | /* We can skip this block, and probably several more */ | 1636 | /* We can skip this block, and probably several more */ |