Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108525
b: refs/heads/master
c: c89a8ee
h: refs/heads/master
i:
  108523: 8e30ce3
v: v3
  • Loading branch information
NeilBrown committed Aug 5, 2008
1 parent 5433965 commit 4e56282
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac4090d24c6a26211bc4523d920376e054d4f3f8
refs/heads/master: c89a8eee61540df04fc83f32f51ef0f46ec018b1
13 changes: 12 additions & 1 deletion trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -6003,7 +6003,7 @@ static int remove_and_add_spares(mddev_t *mddev)
}
}

if (mddev->degraded) {
if (mddev->degraded && ! mddev->ro) {
rdev_for_each(rdev, rtmp, mddev) {
if (rdev->raid_disk >= 0 &&
!test_bit(In_sync, &rdev->flags) &&
Expand Down Expand Up @@ -6077,6 +6077,8 @@ void md_check_recovery(mddev_t *mddev)
flush_signals(current);
}

if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))
return;
if ( ! (
(mddev->flags && !mddev->external) ||
test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) ||
Expand All @@ -6090,6 +6092,15 @@ void md_check_recovery(mddev_t *mddev)
if (mddev_trylock(mddev)) {
int spares = 0;

if (mddev->ro) {
/* Only thing we do on a ro array is remove
* failed devices.
*/
remove_and_add_spares(mddev);
clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
goto unlock;
}

if (!mddev->external) {
int did_change = 0;
spin_lock_irq(&mddev->write_lock);
Expand Down

0 comments on commit 4e56282

Please sign in to comment.