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 <jinshan.xiong@intel.com>
Change-Id: I43c31a76d78aa294a3e3296a1bb69f4d6fb1423d
Reviewed-on: https://review.whamcloud.com/28256
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
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;
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);