bool used = false;
int i;
- if (!cfs_bitmap_check(lod->lod_ost_bitmap, index))
+ if (!cfs_bitmap_check(lod->lod_ost_bitmap, index)) {
+ QOS_DEBUG("OST%d: been used in conflicting mirror component\n",
+ index);
return true;
+ }
/**
* we've tried our best, all available OSTs have been used in
if (!cfs_bitmap_check(lag->lag_ost_avoid_bitmap, index))
used = false;
else
- QOS_DEBUG("OST%d: has been used in overlapped component "
- "in other mirror\n", index);
+ QOS_DEBUG("OST%d: been used in conflicting mirror component\n",
+ index);
return used;
}
struct dt_object *o;
__u32 stripe_idx = *s_idx;
int rc;
+ ENTRY;
rc = lod_statfs_and_check(env, lod, ost_idx, sfs);
- if (rc) {
- /* this OSP doesn't feel well */
- goto out_return;
- }
+ if (rc)
+ RETURN(rc);
/*
* We expect number of precreated objects in f_ffree at
*/
if (sfs->os_fprecreated == 0 && speed == 0) {
QOS_DEBUG("#%d: precreation is empty\n", ost_idx);
- goto out_return;
+ RETURN(rc);
}
/*
*/
if (sfs->os_state & OS_STATE_DEGRADED && speed < 2) {
QOS_DEBUG("#%d: degraded\n", ost_idx);
- goto out_return;
+ RETURN(rc);
}
/*
* component
*/
if (speed == 0 && lod_comp_is_ost_used(env, lo, ost_idx)) {
- QOS_DEBUG("#%d: used by other component\n", ost_idx);
- goto out_return;
+ QOS_DEBUG("iter %d: OST%d used by other component\n",
+ speed, ost_idx);
+ RETURN(rc);
}
/**
* for the first and second time.
*/
if (speed < 2 && lod_should_avoid_ost(lo, lag, ost_idx)) {
- QOS_DEBUG("#%d: used by overlapped component of other mirror\n",
- ost_idx);
- goto out_return;
+ QOS_DEBUG("iter %d: OST%d used by conflicting mirror "
+ "component\n", speed, ost_idx);
+ RETURN(rc);
}
/*
* do not put >1 objects on a single OST
*/
if (lod_qos_is_ost_used(env, ost_idx, stripe_idx))
- goto out_return;
+ RETURN(rc);
o = lod_qos_declare_object_on(env, lod, ost_idx, th);
if (IS_ERR(o)) {
CDEBUG(D_OTHER, "can't declare new object on #%u: %d\n",
ost_idx, (int) PTR_ERR(o));
rc = PTR_ERR(o);
- goto out_return;
+ RETURN(rc);
}
/*
stripe_idx++;
*s_idx = stripe_idx;
-out_return:
- return rc;
+ RETURN(rc);
}
/**
* OSTs to read the data.
*/
comp = &lo->ldo_comp_entries[lo->ldo_mirrors[i].lme_start];
- if (comp->llc_id == LCME_ID_INVAL ||
+ if (comp->llc_id != LCME_ID_INVAL &&
mirror_id_of(comp->llc_id) ==
mirror_id_of(lod_comp->llc_id))
continue;
/* iterate components of a mirror */
lod_foreach_mirror_comp(comp, lo, i) {
- /* skip non-overlapped or un-instantiated components */
+ /**
+ * skip non-overlapped or un-instantiated components,
+ * NOTE: don't use lod_comp_inited(comp) to judge
+ * whether @comp has been inited, since during
+ * declare phase, comp->llc_stripe has been allocated
+ * while it's init flag not been set until the exec
+ * phase.
+ */
if (!lu_extent_is_overlapped(&comp->llc_extent,
&lod_comp->llc_extent) ||
- !lod_comp_inited(comp) || !comp->llc_stripe)
+ !comp->llc_stripe)
continue;
/**
if (cfs_bitmap_check(bitmap, ost->ltd_index))
continue;
+ QOS_DEBUG("OST%d used in conflicting mirror "
+ "component\n", ost->ltd_index);
cfs_bitmap_set(bitmap, ost->ltd_index);
lag->lag_ost_avail--;
if (rc)
GOTO(put_ldts, rc);
+ QOS_DEBUG("collecting conflict osts for comp[%d]\n",
+ comp_idx);
lod_collect_avoidance(lo, lag, comp_idx);
rc = lod_alloc_qos(env, lo, stripe, ost_indices, flag,
lod_comp = &lo->ldo_comp_entries[i];
extent = &lod_comp->llc_extent;
- CDEBUG(D_QOS, "%lld [%lld, %lld)\n",
- size, extent->e_start, extent->e_end);
+ QOS_DEBUG("comp[%d] %lld "DEXT"\n", i, size, PEXT(extent));
if (!lo->ldo_is_composite || size >= extent->e_start) {
rc = lod_qos_prep_create(env, lo, attr, th, i);
if (rc)