aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-07-27 21:39:24 -0400
committerNeilBrown <neilb@suse.de>2011-07-27 21:39:24 -0400
commite875ecea266a543e643b19e44cf472f1412708f9 (patch)
treeb602d08f7aa4a743d3c27ad55e347d36991f0814 /drivers/md/md.c
parent40c356ce5ad1a6be817825e1da1bc7494349cc6d (diff)
md/raid10 record bad blocks as needed during recovery.
When recovering one or more devices, if all the good devices have bad blocks we should record a bad block on the device being rebuilt. If this fails, we need to abort the recovery. To ensure we don't think that we aborted later than we actually did, we need to move the check for MD_RECOVERY_INTR earlier in md_do_sync, in particular before mddev->curr_resync is updated. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index a6b6471da2bc..d97a62534798 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7165,11 +7165,14 @@ void md_do_sync(mddev_t *mddev)
7165 atomic_add(sectors, &mddev->recovery_active); 7165 atomic_add(sectors, &mddev->recovery_active);
7166 } 7166 }
7167 7167
7168 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery))
7169 break;
7170
7168 j += sectors; 7171 j += sectors;
7169 if (j>1) mddev->curr_resync = j; 7172 if (j>1) mddev->curr_resync = j;
7170 mddev->curr_mark_cnt = io_sectors; 7173 mddev->curr_mark_cnt = io_sectors;
7171 if (last_check == 0) 7174 if (last_check == 0)
7172 /* this is the earliers that rebuilt will be 7175 /* this is the earliest that rebuild will be
7173 * visible in /proc/mdstat 7176 * visible in /proc/mdstat
7174 */ 7177 */
7175 md_new_event(mddev); 7178 md_new_event(mddev);
@@ -7178,10 +7181,6 @@ void md_do_sync(mddev_t *mddev)
7178 continue; 7181 continue;
7179 7182
7180 last_check = io_sectors; 7183 last_check = io_sectors;
7181
7182 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery))
7183 break;
7184
7185 repeat: 7184 repeat:
7186 if (time_after_eq(jiffies, mark[last_mark] + SYNC_MARK_STEP )) { 7185 if (time_after_eq(jiffies, mark[last_mark] + SYNC_MARK_STEP )) {
7187 /* step marks */ 7186 /* step marks */