diff options
author | NeilBrown <neilb@suse.de> | 2012-04-23 20:23:14 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-04-23 20:23:14 -0400 |
commit | ed209584c38fb74b7eecc03e5b1bfe674e591bd8 (patch) | |
tree | a232bb4fbf3a2e143ad57dfa3acad92418c5b12c /drivers/md/md.c | |
parent | a9ad8526bb1af0741a5c0e01155dac08e7bdde60 (diff) |
md: don't call ->add_disk unless there is good reason.
Commit 7bfec5f35c68121e7b18
md/raid5: If there is a spare and a want_replacement device, start replacement.
cause md_check_recovery to call ->add_disk much more often.
Instead of only when the array is degraded, it is now called whenever
md_check_recovery finds anything useful to do, which includes
updating the metadata for clean<->dirty transition.
This causes unnecessary work, and causes info messages from ->add_disk
to be reported much too often.
So refine md_check_recovery to only do any actual recovery checking
(including ->add_disk) if MD_RECOVERY_NEEDED is set.
This fix is suitable for 3.3.y:
Cc: stable@vger.kernel.org
Reported-by: Jan Ceuleers <jan.ceuleers@computer.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index b572e1e386ce..8beb19c3bb44 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -7560,14 +7560,14 @@ void md_check_recovery(struct mddev *mddev) | |||
7560 | * any transients in the value of "sync_action". | 7560 | * any transients in the value of "sync_action". |
7561 | */ | 7561 | */ |
7562 | set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); | 7562 | set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); |
7563 | clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | ||
7564 | /* Clear some bits that don't mean anything, but | 7563 | /* Clear some bits that don't mean anything, but |
7565 | * might be left set | 7564 | * might be left set |
7566 | */ | 7565 | */ |
7567 | clear_bit(MD_RECOVERY_INTR, &mddev->recovery); | 7566 | clear_bit(MD_RECOVERY_INTR, &mddev->recovery); |
7568 | clear_bit(MD_RECOVERY_DONE, &mddev->recovery); | 7567 | clear_bit(MD_RECOVERY_DONE, &mddev->recovery); |
7569 | 7568 | ||
7570 | if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) | 7569 | if (!test_and_clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || |
7570 | test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) | ||
7571 | goto unlock; | 7571 | goto unlock; |
7572 | /* no recovery is running. | 7572 | /* no recovery is running. |
7573 | * remove any failed drives, then | 7573 | * remove any failed drives, then |