diff options
Diffstat (limited to 'drivers/md/raid5.c')
| -rw-r--r-- | drivers/md/raid5.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index adda94df5eb2..0689173fd9f5 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
| @@ -393,6 +393,8 @@ static int calc_degraded(struct r5conf *conf) | |||
| 393 | degraded = 0; | 393 | degraded = 0; |
| 394 | for (i = 0; i < conf->previous_raid_disks; i++) { | 394 | for (i = 0; i < conf->previous_raid_disks; i++) { |
| 395 | struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev); | 395 | struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev); |
| 396 | if (rdev && test_bit(Faulty, &rdev->flags)) | ||
| 397 | rdev = rcu_dereference(conf->disks[i].replacement); | ||
| 396 | if (!rdev || test_bit(Faulty, &rdev->flags)) | 398 | if (!rdev || test_bit(Faulty, &rdev->flags)) |
| 397 | degraded++; | 399 | degraded++; |
| 398 | else if (test_bit(In_sync, &rdev->flags)) | 400 | else if (test_bit(In_sync, &rdev->flags)) |
| @@ -417,6 +419,8 @@ static int calc_degraded(struct r5conf *conf) | |||
| 417 | degraded2 = 0; | 419 | degraded2 = 0; |
| 418 | for (i = 0; i < conf->raid_disks; i++) { | 420 | for (i = 0; i < conf->raid_disks; i++) { |
| 419 | struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev); | 421 | struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev); |
| 422 | if (rdev && test_bit(Faulty, &rdev->flags)) | ||
| 423 | rdev = rcu_dereference(conf->disks[i].replacement); | ||
| 420 | if (!rdev || test_bit(Faulty, &rdev->flags)) | 424 | if (!rdev || test_bit(Faulty, &rdev->flags)) |
| 421 | degraded2++; | 425 | degraded2++; |
| 422 | else if (test_bit(In_sync, &rdev->flags)) | 426 | else if (test_bit(In_sync, &rdev->flags)) |
| @@ -1587,6 +1591,7 @@ static int resize_stripes(struct r5conf *conf, int newsize) | |||
| 1587 | #ifdef CONFIG_MULTICORE_RAID456 | 1591 | #ifdef CONFIG_MULTICORE_RAID456 |
| 1588 | init_waitqueue_head(&nsh->ops.wait_for_ops); | 1592 | init_waitqueue_head(&nsh->ops.wait_for_ops); |
| 1589 | #endif | 1593 | #endif |
| 1594 | spin_lock_init(&nsh->stripe_lock); | ||
| 1590 | 1595 | ||
| 1591 | list_add(&nsh->lru, &newstripes); | 1596 | list_add(&nsh->lru, &newstripes); |
| 1592 | } | 1597 | } |
| @@ -4192,7 +4197,7 @@ static void make_request(struct mddev *mddev, struct bio * bi) | |||
| 4192 | finish_wait(&conf->wait_for_overlap, &w); | 4197 | finish_wait(&conf->wait_for_overlap, &w); |
| 4193 | set_bit(STRIPE_HANDLE, &sh->state); | 4198 | set_bit(STRIPE_HANDLE, &sh->state); |
| 4194 | clear_bit(STRIPE_DELAYED, &sh->state); | 4199 | clear_bit(STRIPE_DELAYED, &sh->state); |
| 4195 | if ((bi->bi_rw & REQ_NOIDLE) && | 4200 | if ((bi->bi_rw & REQ_SYNC) && |
| 4196 | !test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) | 4201 | !test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) |
| 4197 | atomic_inc(&conf->preread_active_stripes); | 4202 | atomic_inc(&conf->preread_active_stripes); |
| 4198 | release_stripe_plug(mddev, sh); | 4203 | release_stripe_plug(mddev, sh); |
