All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] raid10: increment write counter after bio is split
@ 2016-07-28  8:28 Tomasz Majchrzak
  2016-07-30 21:01 ` Shaohua Li
  0 siblings, 1 reply; 4+ messages in thread
From: Tomasz Majchrzak @ 2016-07-28  8:28 UTC (permalink / raw)
  To: linux-raid; +Cc: shli, aleksey.obitotskiy, pawel.baldysiak, artur.paszkiewicz

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 <tomasz.majchrzak@intel.com>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
---
 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 c7de2a5..cfa96b5 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1072,6 +1072,8 @@ static void __make_request(struct mddev *mddev, struct bio *bio)
 	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.
@@ -1455,8 +1457,6 @@ static void raid10_make_request(struct mddev *mddev, struct bio *bio)
 		return;
 	}
 
-	md_write_start(mddev, bio);
-
 	do {
 
 		/*
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] raid10: increment write counter after bio is split
  2016-07-28  8:28 [PATCH] raid10: increment write counter after bio is split Tomasz Majchrzak
@ 2016-07-30 21:01 ` Shaohua Li
  0 siblings, 0 replies; 4+ messages in thread
From: Shaohua Li @ 2016-07-30 21:01 UTC (permalink / raw)
  To: Tomasz Majchrzak
  Cc: linux-raid, aleksey.obitotskiy, pawel.baldysiak,
	artur.paszkiewicz

On Thu, Jul 28, 2016 at 10:28:25AM +0200, Tomasz Majchrzak wrote:
> 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 <tomasz.majchrzak@intel.com>
> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch]raid10: increment write counter after bio is split
@ 2017-03-27 18:13 Shaohua Li
  2017-03-28 11:20 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Shaohua Li @ 2017-03-27 18:13 UTC (permalink / raw)
  To: stable

Commit: 9b622e2bbcf0 ("raid10: increment write counter after bio is split") in
4.8 fixed a regression introduced by commit: 20d0189b1012 ("block: Introduce
new bio_split()") in 3.14. The bug could cause data corruption or hang if
raid10 resync runs, so it's suitable for stable. For some reason it's slipped
asway from marking as stable.

Thanks,
Shaohua

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch]raid10: increment write counter after bio is split
  2017-03-27 18:13 [patch]raid10: " Shaohua Li
@ 2017-03-28 11:20 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2017-03-28 11:20 UTC (permalink / raw)
  To: Shaohua Li; +Cc: stable

On Mon, Mar 27, 2017 at 11:13:06AM -0700, Shaohua Li wrote:
> Commit: 9b622e2bbcf0 ("raid10: increment write counter after bio is split") in
> 4.8 fixed a regression introduced by commit: 20d0189b1012 ("block: Introduce
> new bio_split()") in 3.14. The bug could cause data corruption or hang if
> raid10 resync runs, so it's suitable for stable. For some reason it's slipped
> asway from marking as stable.

Thanks, added to 4.4-stable.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-28 11:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-28  8:28 [PATCH] raid10: increment write counter after bio is split Tomasz Majchrzak
2016-07-30 21:01 ` Shaohua Li
  -- strict thread matches above, loose matches on Subject: below --
2017-03-27 18:13 [patch]raid10: " Shaohua Li
2017-03-28 11:20 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.