aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 4a40a200d769..d35e4c991e38 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1738,7 +1738,7 @@ static int process_checks(struct r1bio *r1_bio)
1738 s = sbio->bi_io_vec[j].bv_page; 1738 s = sbio->bi_io_vec[j].bv_page;
1739 if (memcmp(page_address(p), 1739 if (memcmp(page_address(p),
1740 page_address(s), 1740 page_address(s),
1741 PAGE_SIZE)) 1741 sbio->bi_io_vec[j].bv_len))
1742 break; 1742 break;
1743 } 1743 }
1744 } else 1744 } else
@@ -2386,8 +2386,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp
2386 int ok = 1; 2386 int ok = 1;
2387 for (i = 0 ; i < conf->raid_disks * 2 ; i++) 2387 for (i = 0 ; i < conf->raid_disks * 2 ; i++)
2388 if (r1_bio->bios[i]->bi_end_io == end_sync_write) { 2388 if (r1_bio->bios[i]->bi_end_io == end_sync_write) {
2389 struct md_rdev *rdev = 2389 struct md_rdev *rdev = conf->mirrors[i].rdev;
2390 rcu_dereference(conf->mirrors[i].rdev);
2391 ok = rdev_set_badblocks(rdev, sector_nr, 2390 ok = rdev_set_badblocks(rdev, sector_nr,
2392 min_bad, 0 2391 min_bad, 0
2393 ) && ok; 2392 ) && ok;
@@ -2636,11 +2635,13 @@ static struct r1conf *setup_conf(struct mddev *mddev)
2636 return ERR_PTR(err); 2635 return ERR_PTR(err);
2637} 2636}
2638 2637
2638static int stop(struct mddev *mddev);
2639static int run(struct mddev *mddev) 2639static int run(struct mddev *mddev)
2640{ 2640{
2641 struct r1conf *conf; 2641 struct r1conf *conf;
2642 int i; 2642 int i;
2643 struct md_rdev *rdev; 2643 struct md_rdev *rdev;
2644 int ret;
2644 2645
2645 if (mddev->level != 1) { 2646 if (mddev->level != 1) {
2646 printk(KERN_ERR "md/raid1:%s: raid level not set to mirroring (%d)\n", 2647 printk(KERN_ERR "md/raid1:%s: raid level not set to mirroring (%d)\n",
@@ -2705,7 +2706,11 @@ static int run(struct mddev *mddev)
2705 mddev->queue->backing_dev_info.congested_data = mddev; 2706 mddev->queue->backing_dev_info.congested_data = mddev;
2706 blk_queue_merge_bvec(mddev->queue, raid1_mergeable_bvec); 2707 blk_queue_merge_bvec(mddev->queue, raid1_mergeable_bvec);
2707 } 2708 }
2708 return md_integrity_register(mddev); 2709
2710 ret = md_integrity_register(mddev);
2711 if (ret)
2712 stop(mddev);
2713 return ret;
2709} 2714}
2710 2715
2711static int stop(struct mddev *mddev) 2716static int stop(struct mddev *mddev)