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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 759a61519343c64066a5a14bb97447878aa1297e Mon Sep 17 00:00:00 2001
From: majianpeng <majianpeng@xxxxxxxxx>
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 <majianpeng@xxxxxxxxx>
---
 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

 				
--------------
kedacomkernel
2012-03-19

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux