|
@@ -678,26 +678,23 @@ get_active_stripe(struct r5conf *conf, sector_t sector,
|
|
|
} else
|
|
|
init_stripe(sh, sector, previous);
|
|
|
} else {
|
|
|
+ spin_lock(&conf->device_lock);
|
|
|
if (atomic_read(&sh->count)) {
|
|
|
BUG_ON(!list_empty(&sh->lru)
|
|
|
&& !test_bit(STRIPE_EXPANDING, &sh->state)
|
|
|
&& !test_bit(STRIPE_ON_UNPLUG_LIST, &sh->state)
|
|
|
- && !test_bit(STRIPE_ON_RELEASE_LIST, &sh->state));
|
|
|
+ );
|
|
|
} else {
|
|
|
- spin_lock(&conf->device_lock);
|
|
|
if (!test_bit(STRIPE_HANDLE, &sh->state))
|
|
|
atomic_inc(&conf->active_stripes);
|
|
|
- if (list_empty(&sh->lru) &&
|
|
|
- !test_bit(STRIPE_ON_RELEASE_LIST, &sh->state) &&
|
|
|
- !test_bit(STRIPE_EXPANDING, &sh->state))
|
|
|
- BUG();
|
|
|
+ BUG_ON(list_empty(&sh->lru));
|
|
|
list_del_init(&sh->lru);
|
|
|
if (sh->group) {
|
|
|
sh->group->stripes_cnt--;
|
|
|
sh->group = NULL;
|
|
|
}
|
|
|
- spin_unlock(&conf->device_lock);
|
|
|
}
|
|
|
+ spin_unlock(&conf->device_lock);
|
|
|
}
|
|
|
} while (sh == NULL);
|
|
|
|