diff options
author | Shaohua Li <shli@fb.com> | 2017-12-01 15:12:34 -0500 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-12-01 15:19:48 -0500 |
commit | 18022a1bd3709b74ca31ef0b28fccd52bcd6c504 (patch) | |
tree | e3d3fe238bd4397f503adca6dac7688e8feb933e | |
parent | d2e2ec8222b4cb49c59f6dc6f5c4fe6fb4c80de9 (diff) |
md/raid1/10: add missed blk plug
flush_pending_writes isn't always called with block plug, so add it, and plug
works in nested way.
Signed-off-by: Shaohua Li <shli@fb.com>
-rw-r--r-- | drivers/md/raid1.c | 4 | ||||
-rw-r--r-- | drivers/md/raid10.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index cc9d337a1ed3..6df398e3a008 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -809,11 +809,15 @@ static void flush_pending_writes(struct r1conf *conf) | |||
809 | spin_lock_irq(&conf->device_lock); | 809 | spin_lock_irq(&conf->device_lock); |
810 | 810 | ||
811 | if (conf->pending_bio_list.head) { | 811 | if (conf->pending_bio_list.head) { |
812 | struct blk_plug plug; | ||
812 | struct bio *bio; | 813 | struct bio *bio; |
814 | |||
813 | bio = bio_list_get(&conf->pending_bio_list); | 815 | bio = bio_list_get(&conf->pending_bio_list); |
814 | conf->pending_count = 0; | 816 | conf->pending_count = 0; |
815 | spin_unlock_irq(&conf->device_lock); | 817 | spin_unlock_irq(&conf->device_lock); |
818 | blk_start_plug(&plug); | ||
816 | flush_bio_list(conf, bio); | 819 | flush_bio_list(conf, bio); |
820 | blk_finish_plug(&plug); | ||
817 | } else | 821 | } else |
818 | spin_unlock_irq(&conf->device_lock); | 822 | spin_unlock_irq(&conf->device_lock); |
819 | } | 823 | } |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index b9edbc747a95..c131835cf008 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -894,10 +894,13 @@ static void flush_pending_writes(struct r10conf *conf) | |||
894 | spin_lock_irq(&conf->device_lock); | 894 | spin_lock_irq(&conf->device_lock); |
895 | 895 | ||
896 | if (conf->pending_bio_list.head) { | 896 | if (conf->pending_bio_list.head) { |
897 | struct blk_plug plug; | ||
897 | struct bio *bio; | 898 | struct bio *bio; |
899 | |||
898 | bio = bio_list_get(&conf->pending_bio_list); | 900 | bio = bio_list_get(&conf->pending_bio_list); |
899 | conf->pending_count = 0; | 901 | conf->pending_count = 0; |
900 | spin_unlock_irq(&conf->device_lock); | 902 | spin_unlock_irq(&conf->device_lock); |
903 | blk_start_plug(&plug); | ||
901 | /* flush any pending bitmap writes to disk | 904 | /* flush any pending bitmap writes to disk |
902 | * before proceeding w/ I/O */ | 905 | * before proceeding w/ I/O */ |
903 | bitmap_unplug(conf->mddev->bitmap); | 906 | bitmap_unplug(conf->mddev->bitmap); |
@@ -918,6 +921,7 @@ static void flush_pending_writes(struct r10conf *conf) | |||
918 | generic_make_request(bio); | 921 | generic_make_request(bio); |
919 | bio = next; | 922 | bio = next; |
920 | } | 923 | } |
924 | blk_finish_plug(&plug); | ||
921 | } else | 925 | } else |
922 | spin_unlock_irq(&conf->device_lock); | 926 | spin_unlock_irq(&conf->device_lock); |
923 | } | 927 | } |