From: Jinshan Xiong Date: Thu, 27 Jul 2017 16:49:42 +0000 (-0700) Subject: LU-9802 pfl: swapping lcm_entry_count correctly X-Git-Tag: 2.10.54~28 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=21ea1f7629535090d64ee3355c491a9e35256f23;p=fs%2Flustre-release.git LU-9802 pfl: swapping lcm_entry_count correctly It's a u16 integer so it should use le16_to_cpu() instead of le32_to_cpu(). Test-Parameters: trivial Signed-off-by: Jinshan Xiong Change-Id: I43c31a76d78aa294a3e3296a1bb69f4d6fb1423d Reviewed-on: https://review.whamcloud.com/28256 Reviewed-by: Bobi Jam Reviewed-by: Niu Yawei Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo --- diff --git a/lustre/lod/lod_lov.c b/lustre/lod/lod_lov.c index 89be42f..3fb0f2e 100644 --- a/lustre/lod/lod_lov.c +++ b/lustre/lod/lod_lov.c @@ -1654,12 +1654,12 @@ int lod_verify_striping(struct lod_device *d, const struct lu_buf *buf, RETURN(-EINVAL); } - if (le32_to_cpu(comp_v1->lcm_entry_count) == 0) { + if (le16_to_cpu(comp_v1->lcm_entry_count) == 0) { CDEBUG(D_LAYOUT, "entry count is zero\n"); RETURN(-EINVAL); } - for (i = 0; i < le32_to_cpu(comp_v1->lcm_entry_count); i++) { + for (i = 0; i < le16_to_cpu(comp_v1->lcm_entry_count); i++) { ent = &comp_v1->lcm_entries[i]; ext = &ent->lcme_extent; diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index 1fc0938..e04c202 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -1670,7 +1670,7 @@ static inline int mdt_hsm_set_released(struct lov_mds_md *lmm) if (comp_v1->lcm_entry_count == 0) return -EINVAL; - for (i = 0; i < le32_to_cpu(comp_v1->lcm_entry_count); i++) { + for (i = 0; i < le16_to_cpu(comp_v1->lcm_entry_count); i++) { off = le32_to_cpu(comp_v1->lcm_entries[i].lcme_offset); v1 = (struct lov_mds_md *)((char *)comp_v1 + off); v1->lmm_pattern |= cpu_to_le32(LOV_PATTERN_F_RELEASED);