CDEBUG(level,"stripe_size %u, stripe_count %u\n",
le32_to_cpu(lmm->lmm_stripe_size),
le32_to_cpu(lmm->lmm_stripe_count));
- for (i = 0, lod = lmm->lmm_objects;
- i < (int)le32_to_cpu(lmm->lmm_stripe_count); i++, lod++)
- CDEBUG(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n",
- i, le32_to_cpu(lod->l_ost_idx),
- le64_to_cpu(lod->l_object_gr),
- le64_to_cpu(lod->l_object_id));
+
+ if (le32_to_cpu(lmm->lmm_stripe_count) <= LOV_V1_INSANE_STRIPE_COUNT) {
+ for (i = 0, lod = lmm->lmm_objects;
+ i < (int)le32_to_cpu(lmm->lmm_stripe_count); i++, lod++)
+ CDEBUG(level,
+ "stripe %u idx %u subobj "LPX64"/"LPX64"\n",
+ i, le32_to_cpu(lod->l_ost_idx),
+ le64_to_cpu(lod->l_object_gr),
+ le64_to_cpu(lod->l_object_id));
+ } else {
+ CDEBUG(level, "bad stripe_count %u > max_stripe_count %u\n",
+ le32_to_cpu(lmm->lmm_stripe_count),
+ LOV_V1_INSANE_STRIPE_COUNT);
+ }
}
void lov_dump_lmm_join(int level, struct lov_mds_md_join *lmmj)
lsm->lsm_magic, LOV_MAGIC);
RETURN(-EINVAL);
}
- stripe_count = lsm->lsm_stripe_count;
+ if (!lmmp) {
+ stripe_count = lov_get_stripecnt(lov, lsm->lsm_stripe_count);
+ lsm->lsm_stripe_count = stripe_count;
+ } else {
+ stripe_count = lsm->lsm_stripe_count;
+ }
}
/* XXX LOV STACKING call into osc for sizes */
}
/* Find the max stripecount we should use */
-int lov_get_stripecnt(struct lov_obd *lov, int stripe_count)
+int lov_get_stripecnt(struct lov_obd *lov, __u32 stripe_count)
{
if (!stripe_count)
stripe_count = lov->desc.ld_default_stripe_count;