diff options
author | NeilBrown <neilb@suse.de> | 2006-06-26 09:27:56 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 18:58:39 +0200 |
commit | 07d84d109d8beedd68df9da2e4e9f25c8217e7fb (patch) | |
tree | 09b4749cb2ff1759c076c362891a28ceda2b8520 /drivers/md/raid1.c | |
parent | [PATCH] md: Fix bug that stops raid5 resync from happening (diff) | |
download | linux-07d84d109d8beedd68df9da2e4e9f25c8217e7fb.tar.xz linux-07d84d109d8beedd68df9da2e4e9f25c8217e7fb.zip |
[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 /* before building a request, check if we can skip these blocks.. * This call the bitmap_start_sync doesn't actually record anything */ + if (mddev->bitmap == NULL && + mddev->recovery_cp == MaxSector && + conf->fullsync == 0) { + *skipped = 1; + return max_sector - sector_nr; + } if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) && !conf->fullsync && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { /* We can skip this block, and probably several more */ |