Commit e5de485f authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[PATCH] md: make manual repair work for raid1

Raid1 currently optimises resync using the intent bitmap etc.  This
optimisation is not wanted when we explicitly request a repair through sysfs,
so add appropriate checks.
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f637b9f9
...@@ -1310,7 +1310,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i ...@@ -1310,7 +1310,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
* This call the bitmap_start_sync doesn't actually record anything * This call the bitmap_start_sync doesn't actually record anything
*/ */
if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) && if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&
!conf->fullsync) { !conf->fullsync && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) {
/* We can skip this block, and probably several more */ /* We can skip this block, and probably several more */
*skipped = 1; *skipped = 1;
return sync_blocks; return sync_blocks;
...@@ -1387,7 +1387,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i ...@@ -1387,7 +1387,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
still_degraded = 1; still_degraded = 1;
continue; continue;
} else if (!test_bit(In_sync, &conf->mirrors[i].rdev->flags) || } else if (!test_bit(In_sync, &conf->mirrors[i].rdev->flags) ||
sector_nr + RESYNC_SECTORS > mddev->recovery_cp) { sector_nr + RESYNC_SECTORS > mddev->recovery_cp ||
test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) {
bio->bi_rw = WRITE; bio->bi_rw = WRITE;
bio->bi_end_io = end_sync_write; bio->bi_end_io = end_sync_write;
write_targets ++; write_targets ++;
...@@ -1421,8 +1422,9 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i ...@@ -1421,8 +1422,9 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
break; break;
if (sync_blocks == 0) { if (sync_blocks == 0) {
if (!bitmap_start_sync(mddev->bitmap, sector_nr, if (!bitmap_start_sync(mddev->bitmap, sector_nr,
&sync_blocks, still_degraded) && &sync_blocks, still_degraded) &&
!conf->fullsync) !conf->fullsync &&
!test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
break; break;
if (sync_blocks < (PAGE_SIZE>>9)) if (sync_blocks < (PAGE_SIZE>>9))
BUG(); BUG();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment