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.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 4517f06c41ba..049df6c4a8cc 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -881,8 +881,7 @@ static sector_t wait_barrier(struct r1conf *conf, struct bio *bio)
881 } 881 }
882 882
883 if (bio && bio_data_dir(bio) == WRITE) { 883 if (bio && bio_data_dir(bio) == WRITE) {
884 if (bio->bi_iter.bi_sector >= 884 if (bio->bi_iter.bi_sector >= conf->next_resync) {
885 conf->mddev->curr_resync_completed) {
886 if (conf->start_next_window == MaxSector) 885 if (conf->start_next_window == MaxSector)
887 conf->start_next_window = 886 conf->start_next_window =
888 conf->next_resync + 887 conf->next_resync +
@@ -1516,7 +1515,7 @@ static void close_sync(struct r1conf *conf)
1516 conf->r1buf_pool = NULL; 1515 conf->r1buf_pool = NULL;
1517 1516
1518 spin_lock_irq(&conf->resync_lock); 1517 spin_lock_irq(&conf->resync_lock);
1519 conf->next_resync = 0; 1518 conf->next_resync = MaxSector - 2 * NEXT_NORMALIO_DISTANCE;
1520 conf->start_next_window = MaxSector; 1519 conf->start_next_window = MaxSector;
1521 conf->current_window_requests += 1520 conf->current_window_requests +=
1522 conf->next_window_requests; 1521 conf->next_window_requests;
@@ -2843,8 +2842,7 @@ static struct r1conf *setup_conf(struct mddev *mddev)
2843 2842
2844 abort: 2843 abort:
2845 if (conf) { 2844 if (conf) {
2846 if (conf->r1bio_pool) 2845 mempool_destroy(conf->r1bio_pool);
2847 mempool_destroy(conf->r1bio_pool);
2848 kfree(conf->mirrors); 2846 kfree(conf->mirrors);
2849 safe_put_page(conf->tmppage); 2847 safe_put_page(conf->tmppage);
2850 kfree(conf->poolinfo); 2848 kfree(conf->poolinfo);
@@ -2946,8 +2944,7 @@ static void raid1_free(struct mddev *mddev, void *priv)
2946{ 2944{
2947 struct r1conf *conf = priv; 2945 struct r1conf *conf = priv;
2948 2946
2949 if (conf->r1bio_pool) 2947 mempool_destroy(conf->r1bio_pool);
2950 mempool_destroy(conf->r1bio_pool);
2951 kfree(conf->mirrors); 2948 kfree(conf->mirrors);
2952 safe_put_page(conf->tmppage); 2949 safe_put_page(conf->tmppage);
2953 kfree(conf->poolinfo); 2950 kfree(conf->poolinfo);