diff options
| -rw-r--r-- | drivers/md/raid5.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 676d8b7c5117..cc055da02e2a 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
| @@ -678,26 +678,23 @@ get_active_stripe(struct r5conf *conf, sector_t sector, | |||
| 678 | } else | 678 | } else |
| 679 | init_stripe(sh, sector, previous); | 679 | init_stripe(sh, sector, previous); |
| 680 | } else { | 680 | } else { |
| 681 | spin_lock(&conf->device_lock); | ||
| 681 | if (atomic_read(&sh->count)) { | 682 | if (atomic_read(&sh->count)) { |
| 682 | BUG_ON(!list_empty(&sh->lru) | 683 | BUG_ON(!list_empty(&sh->lru) |
| 683 | && !test_bit(STRIPE_EXPANDING, &sh->state) | 684 | && !test_bit(STRIPE_EXPANDING, &sh->state) |
| 684 | && !test_bit(STRIPE_ON_UNPLUG_LIST, &sh->state) | 685 | && !test_bit(STRIPE_ON_UNPLUG_LIST, &sh->state) |
| 685 | && !test_bit(STRIPE_ON_RELEASE_LIST, &sh->state)); | 686 | ); |
| 686 | } else { | 687 | } else { |
| 687 | spin_lock(&conf->device_lock); | ||
| 688 | if (!test_bit(STRIPE_HANDLE, &sh->state)) | 688 | if (!test_bit(STRIPE_HANDLE, &sh->state)) |
| 689 | atomic_inc(&conf->active_stripes); | 689 | atomic_inc(&conf->active_stripes); |
| 690 | if (list_empty(&sh->lru) && | 690 | BUG_ON(list_empty(&sh->lru)); |
| 691 | !test_bit(STRIPE_ON_RELEASE_LIST, &sh->state) && | ||
| 692 | !test_bit(STRIPE_EXPANDING, &sh->state)) | ||
| 693 | BUG(); | ||
| 694 | list_del_init(&sh->lru); | 691 | list_del_init(&sh->lru); |
| 695 | if (sh->group) { | 692 | if (sh->group) { |
| 696 | sh->group->stripes_cnt--; | 693 | sh->group->stripes_cnt--; |
| 697 | sh->group = NULL; | 694 | sh->group = NULL; |
| 698 | } | 695 | } |
| 699 | spin_unlock(&conf->device_lock); | ||
| 700 | } | 696 | } |
| 697 | spin_unlock(&conf->device_lock); | ||
| 701 | } | 698 | } |
| 702 | } while (sh == NULL); | 699 | } while (sh == NULL); |
| 703 | 700 | ||
