Return-Path: Received: from mail-dm3nam03on0108.outbound.protection.outlook.com ([104.47.41.108]:62150 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754631AbeARVBF (ORCPT ); Thu, 18 Jan 2018 16:01:05 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Tomasz Majchrzak , Shaohua Li , Sasha Levin Subject: [added to the 4.1 stable tree] raid10: increment write counter after bio is split Date: Thu, 18 Jan 2018 20:59:59 +0000 Message-ID: <20180118205908.3220-67-alexander.levin@microsoft.com> References: <20180118205908.3220-1-alexander.levin@microsoft.com> In-Reply-To: <20180118205908.3220-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: Tomasz Majchrzak This patch has been added to the stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 9b622e2bbcf049c82e2550d35fb54ac205965f50 ] md pending write counter must be incremented after bio is split, otherwise it gets decremented too many times in end bio callback and becomes negative. Signed-off-by: Tomasz Majchrzak Reviewed-by: Artur Paszkiewicz Signed-off-by: Shaohua Li Signed-off-by: Sasha Levin --- drivers/md/raid10.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 0ba6c358c6e0..4cbc3df79a2a 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1161,6 +1161,8 @@ static void __make_request(struct mddev *mddev, struc= t bio *bio) int max_sectors; int sectors; =20 + md_write_start(mddev, bio); + /* * Register the new request and wait if the reconstruction * thread has put up a bar for new requests. @@ -1559,8 +1561,6 @@ static void make_request(struct mddev *mddev, struct = bio *bio) return; } =20 - md_write_start(mddev, bio); - do { =20 /* --=20 2.11.0