From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-by2nam03hn0247.outbound.protection.outlook.com ([104.47.42.247]:62936 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753206AbeA1W0z (ORCPT ); Sun, 28 Jan 2018 17:26:55 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Shaohua Li , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 040/100] md/raid1/10: add missed blk plug Date: Sun, 28 Jan 2018 22:26:24 +0000 Message-ID: <20180128222547.7398-40-alexander.levin@microsoft.com> References: <20180128222547.7398-1-alexander.levin@microsoft.com> In-Reply-To: <20180128222547.7398-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Shaohua Li [ Upstream commit 18022a1bd3709b74ca31ef0b28fccd52bcd6c504 ] flush_pending_writes isn't always called with block plug, so add it, and pl= ug works in nested way. Signed-off-by: Shaohua Li Signed-off-by: Sasha Levin --- drivers/md/raid1.c | 4 ++++ drivers/md/raid10.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 5a8216b50e38..788fc0800465 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -810,11 +810,15 @@ static void flush_pending_writes(struct r1conf *conf) spin_lock_irq(&conf->device_lock); =20 if (conf->pending_bio_list.head) { + struct blk_plug plug; struct bio *bio; + bio =3D bio_list_get(&conf->pending_bio_list); conf->pending_count =3D 0; spin_unlock_irq(&conf->device_lock); + blk_start_plug(&plug); flush_bio_list(conf, bio); + blk_finish_plug(&plug); } else spin_unlock_irq(&conf->device_lock); } diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 374df5796649..0d18d3b95201 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -890,10 +890,13 @@ static void flush_pending_writes(struct r10conf *conf= ) spin_lock_irq(&conf->device_lock); =20 if (conf->pending_bio_list.head) { + struct blk_plug plug; struct bio *bio; + bio =3D bio_list_get(&conf->pending_bio_list); conf->pending_count =3D 0; spin_unlock_irq(&conf->device_lock); + blk_start_plug(&plug); /* flush any pending bitmap writes to disk * before proceeding w/ I/O */ bitmap_unplug(conf->mddev->bitmap); @@ -914,6 +917,7 @@ static void flush_pending_writes(struct r10conf *conf) generic_make_request(bio); bio =3D next; } + blk_finish_plug(&plug); } else spin_unlock_irq(&conf->device_lock); } --=20 2.11.0