From fa0fd488acb946d830d0de478e13d157f682902a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 28 Mar 2017 14:00:08 +0200 Subject: [PATCH] 3.18 --- ...ent-write-counter-after-bio-is-split.patch | 42 +++++++++++++++++++ queue-3.18/series | 1 + 2 files changed, 43 insertions(+) create mode 100644 queue-3.18/raid10-increment-write-counter-after-bio-is-split.patch diff --git a/queue-3.18/raid10-increment-write-counter-after-bio-is-split.patch b/queue-3.18/raid10-increment-write-counter-after-bio-is-split.patch new file mode 100644 index 00000000000..d5faf242cd9 --- /dev/null +++ b/queue-3.18/raid10-increment-write-counter-after-bio-is-split.patch @@ -0,0 +1,42 @@ +From 9b622e2bbcf049c82e2550d35fb54ac205965f50 Mon Sep 17 00:00:00 2001 +From: Tomasz Majchrzak +Date: Thu, 28 Jul 2016 10:28:25 +0200 +Subject: raid10: increment write counter after bio is split + +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 { + + /* diff --git a/queue-3.18/series b/queue-3.18/series index 95b84b800a5..a803b1163ef 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -61,3 +61,4 @@ lib-vsprintf.c-improve-sanity-check-in-vsnprintf.patch tty-n_hdlc-fix-lockdep-false-positive.patch tty-n_hdlc-get-rid-of-racy-n_hdlc.tbuf.patch cancel-the-setfilesize-transation-when-io-error-happen.patch +raid10-increment-write-counter-after-bio-is-split.patch -- 2.47.3