md/raid5:Fix recover/replace stop and start repreatedly if handle stipe failed,because one disk had bad blocks.

Started by majianpeng on Mar 20, 2012

Subsystems (2)

Maintainers (3)

open the first message on its own page

Message details and related content
From 759a61519343c64066a5a14bb97447878aa1297e Mon Sep 17 00:00:00 2001
From: majianpeng <redacted>
Date: Mon, 19 Mar 2012 15:59:04 +0800
Subject: [PATCH] md/raid5:Fix recover/replace stop and start repreatedly if
 handle stipe failed,because one disk had bad blocks.

When raid5 recovering,then failed because one disk had bad blocks.
The sync_request() return value which larger than 0 and set
MD_RECOVERY_INTR.Because the statement if (test_bit(MD_RECOVERY_INTR,
&mddev->recovery)) first call,so the mddev->curr_resync did not change.
After the sync done,the mddev->curr_resync did not change.So the
resync_thread will stop and start repeatedly.

Signed-off-by: majianpeng <redacted>
---
 drivers/md/md.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index ce88755..370c9d9 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7261,11 +7261,12 @@ void md_do_sync(struct mddev *mddev)
 			atomic_add(sectors, &mddev->recovery_active);
 		}
 
-		if (test_bit(MD_RECOVERY_INTR, &mddev->recovery))
-			break;
 
 		j += sectors;
 		if (j>1) mddev->curr_resync = j;
+
+		if (test_bit(MD_RECOVERY_INTR, &mddev->recovery))
+			break;
 		mddev->curr_mark_cnt = io_sectors;
 		if (last_check == 0)
 			/* this is the earliest that rebuild will be
-- 
1.7.5.4

 				
--------------
majianpeng
2012-03-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help