md/raid5:Fix recover/replace stop and start repreatedly if handle stipe failed,because one disk had bad blocks.
From 759a61519343c64066a5a14bb97447878aa1297e Mon Sep 17 00:00:00 2001
From: majianpeng <[email protected]>
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 <[email protected]>
--- drivers/md/md.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/md/md.c +3 -2
@@ -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
Signature · 6 lines
1.7.5.4 -------------- kedacomkernel 2012-03-19