aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-10-25 20:54:39 -0400
committerNeilBrown <neilb@suse.de>2011-10-25 20:54:39 -0400
commitd890fa2b0586b6177b119643ff66932127d58afa (patch)
tree48dfb1c192274002fc045996f49915a4d9af3bf8 /drivers/md/raid1.c
parent355840e7a7e56bb2834fd3b0da64da5465f8aeaa (diff)
md: Fix some bugs in recovery_disabled handling.
In 3.0 we changed the way recovery_disabled was handle so that instead of testing against zero, we test an mddev-> value against a conf-> value. Two problems: 1/ one place in raid1 was missed and still sets to '1'. 2/ We didn't explicitly set the conf-> value at array creation time. It defaulted to '0' just like the mddev value does so they could appear equal and thus disable recovery. This did not affect normal 'md' as it calls bind_rdev_to_array which changes the mddev value. However the dmraid interface doesn't call this and so doesn't change ->recovery_disabled; so at array start all recovery is incorrectly disabled. So initialise the 'conf' value to one less that the mddev value, so the will only be the same when explicitly set that way. Reported-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index d8957d74fd2..4602fc57c96 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1519,7 +1519,8 @@ static int fix_sync_read_error(struct r1bio *r1_bio)
1519 abort = 1; 1519 abort = 1;
1520 } 1520 }
1521 if (abort) { 1521 if (abort) {
1522 mddev->recovery_disabled = 1; 1522 conf->recovery_disabled =
1523 mddev->recovery_disabled;
1523 set_bit(MD_RECOVERY_INTR, &mddev->recovery); 1524 set_bit(MD_RECOVERY_INTR, &mddev->recovery);
1524 md_done_sync(mddev, r1_bio->sectors, 0); 1525 md_done_sync(mddev, r1_bio->sectors, 0);
1525 put_buf(r1_bio); 1526 put_buf(r1_bio);
@@ -2436,6 +2437,7 @@ static struct r1conf *setup_conf(struct mddev *mddev)
2436 2437
2437 bio_list_init(&conf->pending_bio_list); 2438 bio_list_init(&conf->pending_bio_list);
2438 conf->pending_count = 0; 2439 conf->pending_count = 0;
2440 conf->recovery_disabled = mddev->recovery_disabled - 1;
2439 2441
2440 conf->last_used = -1; 2442 conf->last_used = -1;
2441 for (i = 0; i < conf->raid_disks; i++) { 2443 for (i = 0; i < conf->raid_disks; i++) {