Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Lustre 2.15.0
-
None
-
3
-
15120
Description
static inline int lmv_mds_md_size(int stripe_count, unsigned int lmm_magic) { switch (lmm_magic) { case LMV_MAGIC_V1:{ struct lmv_mds_md_v1 *lmm1; return sizeof(*lmm1) + stripe_count * sizeof(lmm1->lmv_stripe_fids[0]); } default: return -EINVAL; } }
It's not critical now because of magic is LMV_MAGIC_V1 always but can affect in the future.
In few places the value checked for zero.
lmm_size = lmv_mds_md_size(stripe_count, le32_to_cpu((*lmmp)->lmv_magic));
if (lmm_size == 0)
RETURN(-EINVAL);
So, probably it will be better return zero in case of wrong magic and return type change to size_t.
Attachments
Issue Links
- is related to
-
LU-5439 Function lustre_msg_buflen() can return -EINVAL but it's never checked
- Resolved