le32_to_cpu(lmv_src->lmv_master_mdt_index);
lmv_dst->lmv_hash_type = le32_to_cpu(lmv_src->lmv_hash_type);
lmv_dst->lmv_layout_version = le32_to_cpu(lmv_src->lmv_layout_version);
+ if (lmv_src->lmv_stripe_count > LMV_MAX_STRIPE_COUNT)
+ return;
for (i = 0; i < lmv_src->lmv_stripe_count; i++)
fid_le_to_cpu(&lmv_dst->lmv_stripe_fids[i],
&lmv_src->lmv_stripe_fids[i]);
static inline bool lmv_is_splitting(const struct lmv_mds_md_v1 *lmv)
{
- LASSERT(lmv_is_sane2(lmv));
+ if (!lmv_is_sane2(lmv))
+ return false;
+
return lmv_hash_is_splitting(cpu_to_le32(lmv->lmv_hash_type));
}
static inline bool lmv_is_merging(const struct lmv_mds_md_v1 *lmv)
{
- LASSERT(lmv_is_sane2(lmv));
+ if (!lmv_is_sane2(lmv))
+ return false;
+
return lmv_hash_is_merging(cpu_to_le32(lmv->lmv_hash_type));
}
static inline bool lmv_is_migrating(const struct lmv_mds_md_v1 *lmv)
{
- LASSERT(lmv_is_sane(lmv));
+ if (!lmv_is_sane(lmv))
+ return false;
+
return lmv_hash_is_migrating(cpu_to_le32(lmv->lmv_hash_type));
}
static inline bool lmv_is_restriping(const struct lmv_mds_md_v1 *lmv)
{
- LASSERT(lmv_is_sane2(lmv));
+ if (!lmv_is_sane2(lmv))
+ return false;
+
return lmv_hash_is_splitting(cpu_to_le32(lmv->lmv_hash_type)) ||
lmv_hash_is_merging(cpu_to_le32(lmv->lmv_hash_type));
}
static inline bool lmv_is_layout_changing(const struct lmv_mds_md_v1 *lmv)
{
- LASSERT(lmv_is_sane2(lmv));
+ if (!lmv_is_sane2(lmv))
+ return false;
+
return lmv_hash_is_splitting(cpu_to_le32(lmv->lmv_hash_type)) ||
lmv_hash_is_merging(cpu_to_le32(lmv->lmv_hash_type)) ||
lmv_hash_is_migrating(cpu_to_le32(lmv->lmv_hash_type));