aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 6eb95451f161..25b893ec562e 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6003,7 +6003,7 @@ static int remove_and_add_spares(mddev_t *mddev)
6003 } 6003 }
6004 } 6004 }
6005 6005
6006 if (mddev->degraded) { 6006 if (mddev->degraded && ! mddev->ro) {
6007 rdev_for_each(rdev, rtmp, mddev) { 6007 rdev_for_each(rdev, rtmp, mddev) {
6008 if (rdev->raid_disk >= 0 && 6008 if (rdev->raid_disk >= 0 &&
6009 !test_bit(In_sync, &rdev->flags) && 6009 !test_bit(In_sync, &rdev->flags) &&
@@ -6077,6 +6077,8 @@ void md_check_recovery(mddev_t *mddev)
6077 flush_signals(current); 6077 flush_signals(current);
6078 } 6078 }
6079 6079
6080 if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))
6081 return;
6080 if ( ! ( 6082 if ( ! (
6081 (mddev->flags && !mddev->external) || 6083 (mddev->flags && !mddev->external) ||
6082 test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || 6084 test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) ||
@@ -6090,6 +6092,15 @@ void md_check_recovery(mddev_t *mddev)
6090 if (mddev_trylock(mddev)) { 6092 if (mddev_trylock(mddev)) {
6091 int spares = 0; 6093 int spares = 0;
6092 6094
6095 if (mddev->ro) {
6096 /* Only thing we do on a ro array is remove
6097 * failed devices.
6098 */
6099 remove_and_add_spares(mddev);
6100 clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
6101 goto unlock;
6102 }
6103
6093 if (!mddev->external) { 6104 if (!mddev->external) {
6094 int did_change = 0; 6105 int did_change = 0;
6095 spin_lock_irq(&mddev->write_lock); 6106 spin_lock_irq(&mddev->write_lock);