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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index fd86b372692d..851023e2ba5d 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -981,7 +981,12 @@ static void raid1_unplug(struct blk_plug_cb *cb, bool from_schedule)
981 while (bio) { /* submit pending writes */ 981 while (bio) { /* submit pending writes */
982 struct bio *next = bio->bi_next; 982 struct bio *next = bio->bi_next;
983 bio->bi_next = NULL; 983 bio->bi_next = NULL;
984 generic_make_request(bio); 984 if (unlikely((bio->bi_rw & REQ_DISCARD) &&
985 !blk_queue_discard(bdev_get_queue(bio->bi_bdev))))
986 /* Just ignore it */
987 bio_endio(bio, 0);
988 else
989 generic_make_request(bio);
985 bio = next; 990 bio = next;
986 } 991 }
987 kfree(plug); 992 kfree(plug);
@@ -2901,6 +2906,7 @@ static int stop(struct mddev *mddev)
2901 if (conf->r1bio_pool) 2906 if (conf->r1bio_pool)
2902 mempool_destroy(conf->r1bio_pool); 2907 mempool_destroy(conf->r1bio_pool);
2903 kfree(conf->mirrors); 2908 kfree(conf->mirrors);
2909 safe_put_page(conf->tmppage);
2904 kfree(conf->poolinfo); 2910 kfree(conf->poolinfo);
2905 kfree(conf); 2911 kfree(conf);
2906 mddev->private = NULL; 2912 mddev->private = NULL;