linux-raid.vger.kernel.org archive mirror
 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; 2+ 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] 2+ 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; 2+ 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] 2+ messages in thread

end of thread, other threads:[~2016-07-30 21:01 UTC | newest]

Thread overview: 2+ 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).