* then user has specified ost list for this component.
*/
if (!lod_comp_inited(lod_comp)) {
+ __u16 stripe_count;
+
if (objs[0].l_ost_idx != (__u32)-1UL) {
+ stripe_count = lod_comp_entry_stripe_count(
+ lo, lod_comp, false);
/**
* load the user specified ost list, when this
* component is instantiated later, it will be
* used in lod_alloc_ost_list().
*/
- lod_comp->llc_ostlist.op_count =
- lod_comp->llc_stripe_count;
+ lod_comp->llc_ostlist.op_count = stripe_count;
lod_comp->llc_ostlist.op_size =
- lod_comp->llc_stripe_count *
- sizeof(__u32);
+ stripe_count * sizeof(__u32);
OBD_ALLOC(lod_comp->llc_ostlist.op_array,
lod_comp->llc_ostlist.op_size);
if (!lod_comp->llc_ostlist.op_array)
GOTO(out, rc = -ENOMEM);
- for (j = 0; j < lod_comp->llc_stripe_count; j++)
+ for (j = 0; j < stripe_count; j++)
lod_comp->llc_ostlist.op_array[j] =
le32_to_cpu(objs[j].l_ost_idx);
{
LASSERT(inuse != NULL);
if (inuse->op_size && !lod_comp_is_ost_used(inuse, ost)) {
- LASSERT(inuse->op_count * sizeof(inuse->op_array[0]) <
- inuse->op_size);
+ LASSERTF(inuse->op_count * sizeof(inuse->op_array[0]) <
+ inuse->op_size,
+ "count %d size %u", inuse->op_count, inuse->op_size);
inuse->op_array[inuse->op_count] = ost;
inuse->op_count++;
}
struct pool_desc *pool = NULL;
struct ost_pool *osts;
unsigned int i;
- __u32 nfound, good_osts, stripe_count, stripe_count_min;
+ __u32 nfound, good_osts, stripe_count, stripe_count_min;
+ __u32 inuse_old_count = inuse->op_count;
int rc = 0;
ENTRY;
}
LASSERTF(nfound <= inuse->op_count,
"nfound:%d, op_count:%u\n", nfound, inuse->op_count);
- inuse->op_count -= nfound;
+ inuse->op_count = inuse_old_count;
/* makes sense to rebalance next time */
lod->lod_qos.lq_dirty = 1;