Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756904AbdDPKyX (ORCPT ); Sun, 16 Apr 2017 06:54:23 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59448 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756838AbdDPKyQ (ORCPT ); Sun, 16 Apr 2017 06:54:16 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomasz Majchrzak , Artur Paszkiewicz , Shaohua Li Subject: [PATCH 3.18 064/145] raid10: increment write counter after bio is split Date: Sun, 16 Apr 2017 12:49:17 +0200 Message-Id: <20170416080204.001110203@linuxfoundation.org> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170416080200.205458595@linuxfoundation.org> References: <20170416080200.205458595@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1099 Lines: 42 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tomasz Majchrzak commit 9b622e2bbcf049c82e2550d35fb54ac205965f50 upstream. 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: Greg Kroah-Hartman --- drivers/md/raid10.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1171,6 +1171,8 @@ static void __make_request(struct mddev int max_sectors; int sectors; + md_write_start(mddev, bio); + /* * Register the new request and wait if the reconstruction * thread has put up a bar for new requests. @@ -1556,8 +1558,6 @@ static void make_request(struct mddev *m return; } - md_write_start(mddev, bio); - do { /*