Skip to content

Commit 18022a1

Browse files
committed
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 <[email protected]>
1 parent d2e2ec8 commit 18022a1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/md/raid1.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,11 +809,15 @@ static void flush_pending_writes(struct r1conf *conf)
809809
spin_lock_irq(&conf->device_lock);
810810

811811
if (conf->pending_bio_list.head) {
812+
struct blk_plug plug;
812813
struct bio *bio;
814+
813815
bio = bio_list_get(&conf->pending_bio_list);
814816
conf->pending_count = 0;
815817
spin_unlock_irq(&conf->device_lock);
818+
blk_start_plug(&plug);
816819
flush_bio_list(conf, bio);
820+
blk_finish_plug(&plug);
817821
} else
818822
spin_unlock_irq(&conf->device_lock);
819823
}

drivers/md/raid10.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,10 +894,13 @@ static void flush_pending_writes(struct r10conf *conf)
894894
spin_lock_irq(&conf->device_lock);
895895

896896
if (conf->pending_bio_list.head) {
897+
struct blk_plug plug;
897898
struct bio *bio;
899+
898900
bio = bio_list_get(&conf->pending_bio_list);
899901
conf->pending_count = 0;
900902
spin_unlock_irq(&conf->device_lock);
903+
blk_start_plug(&plug);
901904
/* flush any pending bitmap writes to disk
902905
* before proceeding w/ I/O */
903906
bitmap_unplug(conf->mddev->bitmap);
@@ -918,6 +921,7 @@ static void flush_pending_writes(struct r10conf *conf)
918921
generic_make_request(bio);
919922
bio = next;
920923
}
924+
blk_finish_plug(&plug);
921925
} else
922926
spin_unlock_irq(&conf->device_lock);
923927
}

0 commit comments

Comments
 (0)