diff options
author | majianpeng <majianpeng@gmail.com> | 2012-04-01 11:16:59 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-04-03 01:37:38 -0400 |
commit | c6d2e084c7411f61f2b446d94989e5aaf9879b0f (patch) | |
tree | 521616d7bd6ff7eb38217bed1b81c5960fa2023d /drivers/md | |
parent | a42f9d83b5c05dc6e678a1f0cd9767502c2c58de (diff) |
md/raid5: Fix a bug about judging if the operation is syncing or replacing
When create a raid5 using assume-clean and echo check or repair to
sync_action.Then component disks did not operated IO but the raid
check/resync faster than normal.
Because the judgement in function analyse_stripe():
if (do_recovery ||
sh->sector >= conf->mddev->recovery_cp)
s->syncing = 1;
else
s->replacing = 1;
When check or repair,the recovery_cp == MaxSectore,so syncing equal zero
not one.
This bug was introduced by commit 9a3e1101b827
md/raid5: detect and handle replacements during recovery.
so this patch is suitable for 3.3-stable.
Cc: stable@vger.kernel.org
Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid5.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 9799be80bf31..f351422938e0 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3279,12 +3279,14 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s) | |||
3279 | /* If there is a failed device being replaced, | 3279 | /* If there is a failed device being replaced, |
3280 | * we must be recovering. | 3280 | * we must be recovering. |
3281 | * else if we are after recovery_cp, we must be syncing | 3281 | * else if we are after recovery_cp, we must be syncing |
3282 | * else if MD_RECOVERY_REQUESTED is set, we also are syncing. | ||
3282 | * else we can only be replacing | 3283 | * else we can only be replacing |
3283 | * sync and recovery both need to read all devices, and so | 3284 | * sync and recovery both need to read all devices, and so |
3284 | * use the same flag. | 3285 | * use the same flag. |
3285 | */ | 3286 | */ |
3286 | if (do_recovery || | 3287 | if (do_recovery || |
3287 | sh->sector >= conf->mddev->recovery_cp) | 3288 | sh->sector >= conf->mddev->recovery_cp || |
3289 | test_bit(MD_RECOVERY_REQUESTED, &(conf->mddev->recovery))) | ||
3288 | s->syncing = 1; | 3290 | s->syncing = 1; |
3289 | else | 3291 | else |
3290 | s->replacing = 1; | 3292 | s->replacing = 1; |